|
|
@ -6,9 +6,9 @@ |
|
|
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
|
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
|
|
|
|
|
|
|
<sql id="whereForMap"> |
|
|
<sql id="whereForMap"> |
|
|
<if test=" ids != null"> and (res.id) in |
|
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
( #{item}) |
|
|
|
|
|
|
|
|
<if test=" pkList != null"> and (res.group_id, res.userid) in |
|
|
|
|
|
<foreach collection="pkList" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
( #{item.groupId}, #{item.userid}) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
<if test="key != null and key !='' "> </if> |
|
|
<if test="key != null and key !='' "> </if> |
|
|
@ -59,14 +59,16 @@ |
|
|
<select id="selectOneObject" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="com.xm.core.entity.XmProjectGroupUser"> |
|
|
<select id="selectOneObject" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="com.xm.core.entity.XmProjectGroupUser"> |
|
|
select * from xm_project_group_user res |
|
|
select * from xm_project_group_user res |
|
|
where |
|
|
where |
|
|
res.id = #{id} |
|
|
|
|
|
|
|
|
res.group_id = #{groupId} |
|
|
|
|
|
and res.userid = #{userid} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 通过主键查询获取数据对象 返回map--> |
|
|
<!-- 通过主键查询获取数据对象 返回map--> |
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
select * from xm_project_group_user res |
|
|
select * from xm_project_group_user res |
|
|
where |
|
|
where |
|
|
res.id = #{id} |
|
|
|
|
|
|
|
|
res.group_id = #{groupId} |
|
|
|
|
|
and res.userid = #{userid} |
|
|
</select> |
|
|
</select> |
|
|
<!-- 获取数据条目 返回long --> |
|
|
<!-- 获取数据条目 返回long --> |
|
|
<select id="countByWhere" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="long"> |
|
|
<select id="countByWhere" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="long"> |
|
|
@ -75,12 +77,12 @@ |
|
|
<include refid="where"/> |
|
|
<include refid="where"/> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
<!-- 新增一条记录 主键id,--> |
|
|
|
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmProjectGroupUser" useGeneratedKeys="false" keyProperty="id"> |
|
|
|
|
|
|
|
|
<!-- 新增一条记录 主键group_id,userid,--> |
|
|
|
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmProjectGroupUser" useGeneratedKeys="false" > |
|
|
insert into xm_project_group_user( |
|
|
insert into xm_project_group_user( |
|
|
<include refid="columns"/> |
|
|
<include refid="columns"/> |
|
|
) values ( |
|
|
) values ( |
|
|
#{joinTime},#{id},#{groupId},#{userid},#{username},#{isHead},#{outTime},#{status},#{bizProcInstId},#{bizFlowState},#{projectId} |
|
|
|
|
|
|
|
|
#{joinTime},#{groupId},#{userid},#{username},#{outTime},#{status},#{obranchId},#{isPri},#{seqNo} |
|
|
) |
|
|
) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
@ -95,7 +97,7 @@ |
|
|
<!-- 按主键删除一条记录--> |
|
|
<!-- 按主键删除一条记录--> |
|
|
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectGroupUser"> |
|
|
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectGroupUser"> |
|
|
delete from xm_project_group_user |
|
|
delete from xm_project_group_user |
|
|
where id = #{id} |
|
|
|
|
|
|
|
|
where group_id = #{groupId} and userid = #{userid} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
@ -104,7 +106,7 @@ |
|
|
<set> |
|
|
<set> |
|
|
<include refid="someFieldSet"/> |
|
|
<include refid="someFieldSet"/> |
|
|
</set> |
|
|
</set> |
|
|
where id = #{id} |
|
|
|
|
|
|
|
|
where group_id = #{groupId} and userid = #{userid} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<!-- 根据主键修改一条记录 --> |
|
|
<!-- 根据主键修改一条记录 --> |
|
|
@ -113,7 +115,7 @@ |
|
|
<set> |
|
|
<set> |
|
|
<include refid="set"/> |
|
|
<include refid="set"/> |
|
|
</set> |
|
|
</set> |
|
|
where id = #{id} |
|
|
|
|
|
|
|
|
where group_id = #{groupId} and userid = #{userid} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
|
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
|
@ -127,75 +129,64 @@ |
|
|
update xm_project_group_user |
|
|
update xm_project_group_user |
|
|
set |
|
|
set |
|
|
<include refid="batchSet"/> |
|
|
<include refid="batchSet"/> |
|
|
where id = #{item.id} |
|
|
|
|
|
|
|
|
where group_id = #{item.groupId} and userid = #{item.userid} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</update> |
|
|
</update> |
|
|
<!-- 批量删除 --> |
|
|
<!-- 批量删除 --> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
delete from xm_project_group_user |
|
|
delete from xm_project_group_user |
|
|
where |
|
|
where |
|
|
(id) in |
|
|
|
|
|
|
|
|
(group_id, userid) in |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
( #{item.id} ) |
|
|
|
|
|
|
|
|
( #{item.groupId}, #{item.userid} ) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
<!--sql片段 列--> |
|
|
<sql id="columns"> |
|
|
<sql id="columns"> |
|
|
join_time,id,group_id,userid,username,is_head,out_time,status,biz_proc_inst_id,biz_flow_state,project_id |
|
|
|
|
|
|
|
|
join_time,group_id,userid,username,out_time,status,obranch_id,is_pri,seq_no |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
<sql id="where"> |
|
|
<sql id="where"> |
|
|
<if test="joinTime != null"> and date_format(res.join_time,'%Y-%m-%d') = date_format(#{joinTime},'%Y-%m-%d') </if> |
|
|
<if test="joinTime != null"> and date_format(res.join_time,'%Y-%m-%d') = date_format(#{joinTime},'%Y-%m-%d') </if> |
|
|
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
|
|
|
|
<if test="groupId != null and groupId != ''"> and res.group_id = #{groupId} </if> |
|
|
<if test="groupId != null and groupId != ''"> and res.group_id = #{groupId} </if> |
|
|
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> |
|
|
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> |
|
|
<if test="username != null and username != ''"> and res.username = #{username} </if> |
|
|
<if test="username != null and username != ''"> and res.username = #{username} </if> |
|
|
<if test="isHead != null and isHead != ''"> and res.is_head = #{isHead} </if> |
|
|
|
|
|
<if test="outTime != null"> and date_format(res.out_time,'%Y-%m-%d') = date_format(#{outTime},'%Y-%m-%d') </if> |
|
|
<if test="outTime != null"> and date_format(res.out_time,'%Y-%m-%d') = date_format(#{outTime},'%Y-%m-%d') </if> |
|
|
<if test="status != null and status != ''"> and res.status = #{status} </if> |
|
|
<if test="status != null and status != ''"> and res.status = #{status} </if> |
|
|
<if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if> |
|
|
|
|
|
<if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if> |
|
|
|
|
|
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if> |
|
|
|
|
|
|
|
|
<if test="obranchId != null and obranchId != ''"> and res.obranch_id = #{obranchId} </if> |
|
|
|
|
|
<if test="isPri != null and isPri != ''"> and res.is_pri = #{isPri} </if> |
|
|
|
|
|
<if test="seqNo != null and seqNo != ''"> and res.seq_no = #{seqNo} </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 更新字段 --> |
|
|
<!--sql片段 更新字段 --> |
|
|
<sql id="set"> |
|
|
<sql id="set"> |
|
|
join_time = #{joinTime}, |
|
|
join_time = #{joinTime}, |
|
|
group_id = #{groupId}, |
|
|
|
|
|
userid = #{userid}, |
|
|
|
|
|
username = #{username}, |
|
|
username = #{username}, |
|
|
is_head = #{isHead}, |
|
|
|
|
|
out_time = #{outTime}, |
|
|
out_time = #{outTime}, |
|
|
status = #{status}, |
|
|
status = #{status}, |
|
|
biz_proc_inst_id = #{bizProcInstId}, |
|
|
|
|
|
biz_flow_state = #{bizFlowState}, |
|
|
|
|
|
project_id = #{projectId} |
|
|
|
|
|
|
|
|
obranch_id = #{obranchId}, |
|
|
|
|
|
is_pri = #{isPri}, |
|
|
|
|
|
seq_no = #{seqNo} |
|
|
</sql> |
|
|
</sql> |
|
|
<sql id="someFieldSet"> |
|
|
<sql id="someFieldSet"> |
|
|
<if test="joinTime != null"> join_time = #{joinTime}, </if> |
|
|
<if test="joinTime != null"> join_time = #{joinTime}, </if> |
|
|
<if test="groupId != null and groupId != ''"> group_id = #{groupId}, </if> |
|
|
|
|
|
<if test="userid != null and userid != ''"> userid = #{userid}, </if> |
|
|
|
|
|
<if test="username != null and username != ''"> username = #{username}, </if> |
|
|
<if test="username != null and username != ''"> username = #{username}, </if> |
|
|
<if test="isHead != null and isHead != ''"> is_head = #{isHead}, </if> |
|
|
|
|
|
<if test="outTime != null"> out_time = #{outTime}, </if> |
|
|
<if test="outTime != null"> out_time = #{outTime}, </if> |
|
|
<if test="status != null and status != ''"> status = #{status}, </if> |
|
|
<if test="status != null and status != ''"> status = #{status}, </if> |
|
|
<if test="bizProcInstId != null and bizProcInstId != ''"> biz_proc_inst_id = #{bizProcInstId}, </if> |
|
|
|
|
|
<if test="bizFlowState != null and bizFlowState != ''"> biz_flow_state = #{bizFlowState}, </if> |
|
|
|
|
|
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if> |
|
|
|
|
|
|
|
|
<if test="obranchId != null and obranchId != ''"> obranch_id = #{obranchId}, </if> |
|
|
|
|
|
<if test="isPri != null and isPri != ''"> is_pri = #{isPri}, </if> |
|
|
|
|
|
<if test="seqNo != null and seqNo != ''"> seq_no = #{seqNo}, </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 批量更新 --> |
|
|
<!--sql片段 批量更新 --> |
|
|
<sql id="batchSet"> |
|
|
<sql id="batchSet"> |
|
|
join_time = #{item.joinTime}, |
|
|
join_time = #{item.joinTime}, |
|
|
group_id = #{item.groupId}, |
|
|
|
|
|
userid = #{item.userid}, |
|
|
|
|
|
username = #{item.username}, |
|
|
username = #{item.username}, |
|
|
is_head = #{item.isHead}, |
|
|
|
|
|
out_time = #{item.outTime}, |
|
|
out_time = #{item.outTime}, |
|
|
status = #{item.status}, |
|
|
status = #{item.status}, |
|
|
biz_proc_inst_id = #{item.bizProcInstId}, |
|
|
|
|
|
biz_flow_state = #{item.bizFlowState}, |
|
|
|
|
|
project_id = #{item.projectId} |
|
|
|
|
|
|
|
|
obranch_id = #{item.obranchId}, |
|
|
|
|
|
is_pri = #{item.isPri}, |
|
|
|
|
|
seq_no = #{item.seqNo} |
|
|
</sql> |
|
|
</sql> |
|
|
</mapper> |
|
|
</mapper> |