<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!--
|
* @title: 会议参与人表
|
* @description: 自定义sql,请自行实现业务逻辑
|
* @company: hugeinfo
|
* @author: liyj
|
* @time:2022-03-28 16:09:55
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.meet.dao.mapper.MeetUserMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.meet.domain.po.MeetUser">
|
<result property="id" column="id"/>
|
<result property="caseId" column="case_id"/>
|
<result property="meetId" column="meet_id"/>
|
<result property="userType" column="user_type"/>
|
<result property="userTypeName" column="user_type_name"/>
|
<result property="userId" column="user_id"/>
|
<result property="userName" column="user_name"/>
|
<result property="userMobile" column="user_mobile"/>
|
<result property="userIdcard" column="user_idcard"/>
|
<result property="meetWay" column="meet_way"/>
|
<result property="noticeShortId" column="notice_short_id"/>
|
<result property="fixStatus" column="fix_status"/>
|
<result property="fixStatusName" column="fix_status_name"/>
|
<result property="fixTime" column="fix_time"/>
|
<result property="fixContent" column="fix_content"/>
|
<result property="signStatus" column="sign_status"/>
|
<result property="signStatusName" column="sign_status_name"/>
|
<result property="custId" column="cust_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_meet_user</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
case_id,
|
meet_id,
|
user_type,
|
user_type_name,
|
user_id,
|
user_name,
|
user_mobile,
|
user_idcard,
|
meet_way,
|
notice_short_id,
|
fix_status,
|
fix_status_name,
|
fix_time,
|
fix_content,
|
sign_status,
|
sign_status_name,
|
cust_id,
|
create_time,
|
update_time
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.meetId != null">meet_id = #{entity.meetId},</if>
|
<if test="entity.userType != null">user_type = #{entity.userType},</if>
|
<if test="entity.userTypeName != null">user_type_name = #{entity.userTypeName},</if>
|
<if test="entity.userId != null">user_id = #{entity.userId},</if>
|
<if test="entity.userName != null">user_name = #{entity.userName},</if>
|
<if test="entity.userMobile != null">user_mobile = #{entity.userMobile},</if>
|
<if test="entity.userIdcard != null">user_idcard = #{entity.userIdcard},</if>
|
<if test="entity.meetWay != null">meet_way = #{entity.meetWay},</if>
|
<if test="entity.noticeShortId != null">notice_short_id = #{entity.noticeShortId},</if>
|
<if test="entity.fixStatus != null">fix_status = #{entity.fixStatus},</if>
|
<if test="entity.fixStatusName != null">fix_status_name = #{entity.fixStatusName},</if>
|
<if test="entity.fixTime != null">fix_time = #{entity.fixTime},</if>
|
<if test="entity.fixContent != null">fix_content = #{entity.fixContent},</if>
|
<if test="entity.signStatus != null">sign_status = #{entity.signStatus},</if>
|
<if test="entity.signStatusName != null">sign_status_name = #{entity.signStatusName},</if>
|
<if test="entity.custId != null">cust_id = #{entity.custId},</if>
|
<if test="entity.createTime != null">create_time = #{entity.createTime},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime}</if>
|
</sql>
|
<!-- 条件 -->
|
<sql id="where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.id != null and terms.id !=''">
|
and id = #{terms.id}
|
</if>
|
<if test="terms.caseId != null and terms.caseId !=''">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.meetId != null and terms.meetId !=''">
|
and meet_id = #{terms.meetId}
|
</if>
|
<if test="terms.userType != null and terms.userType !=''">
|
and user_type = #{terms.userType}
|
</if>
|
<if test="terms.userTypeName != null and terms.userTypeName !=''">
|
and user_type_name = #{terms.userTypeName}
|
</if>
|
<if test="terms.userId != null and terms.userId !=''">
|
and user_id = #{terms.userId}
|
</if>
|
<if test="terms.userName != null and terms.userName !=''">
|
and user_name = #{terms.userName}
|
</if>
|
<if test="terms.userMobile != null and terms.userMobile !=''">
|
and user_mobile = #{terms.userMobile}
|
</if>
|
<if test="terms.userIdcard != null and terms.userIdcard !=''">
|
and user_idcard = #{terms.userIdcard}
|
</if>
|
<if test="terms.meetWay != null and terms.meetWay !=''">
|
and meet_way = #{terms.meetWay}
|
</if>
|
<if test="terms.noticeShortId != null and terms.noticeShortId !=''">
|
and notice_short_id = #{terms.noticeShortId}
|
</if>
|
<if test="terms.fixStatus != null and terms.fixStatus !=''">
|
and fix_status = #{terms.fixStatus}
|
</if>
|
<if test="terms.fixStatusName != null and terms.fixStatusName !=''">
|
and fix_status_name = #{terms.fixStatusName}
|
</if>
|
<if test="terms.fixTime != null and terms.fixTime !=''">
|
and fix_time = #{terms.fixTime}
|
</if>
|
<if test="terms.fixContent != null and terms.fixContent !=''">
|
and fix_content = #{terms.fixContent}
|
</if>
|
<if test="terms.signStatus != null and terms.signStatus !=''">
|
and sign_status = #{terms.signStatus}
|
</if>
|
<if test="terms.signStatusName != null and terms.signStatusName !=''">
|
and sign_status_name = #{terms.signStatusName}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.createTime != null and terms.createTime !=''">
|
and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime}
|
</if>
|
<if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
|
and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
|
</if>
|
<if test="terms.updateTime != null and terms.updateTime !=''">
|
and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime}
|
</if>
|
<if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''">
|
and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart}
|
and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd})
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateMeetUser">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateMeetUserTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteMeetUser">
|
delete from
|
<include refid="table-name" />
|
where id = #{id}
|
</delete>
|
<!-- 根据条件查询 -->
|
<select id="listTerms" resultMap="dataResult">
|
select
|
<include refid="column-part"/>
|
from
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件统计 -->
|
<select id="countTerms" resultType="java.lang.Long">
|
select
|
COUNT(1)
|
from
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件分页查询 -->
|
<select id="pageTerms" resultMap="dataResult">
|
SELECT
|
<include refid="column-part"/>
|
FROM
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
</mapper>
|