|
|
@ -3,34 +3,50 @@ |
|
|
<mapper namespace="com.xm.core.entity.XmMenu"> |
|
|
<mapper namespace="com.xm.core.entity.XmMenu"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--开始 自定sql函数区域 --> |
|
|
|
|
|
<!--请在此区域添加自定义函数--> |
|
|
|
|
|
|
|
|
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="whereForMap"> |
|
|
|
|
|
<if test=" menuIds != null"> and (res.menu_id) in |
|
|
|
|
|
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
( #{item}) |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=' iterationFilterType!=null and iterationFilterType!=""'> |
|
|
|
|
|
and <if test='iterationFilterType=="not-join"'> not </if> |
|
|
|
|
|
exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=' taskFilterType!=null and taskFilterType!="" '> |
|
|
|
|
|
and <if test='taskFilterType=="not-join"'> not </if> |
|
|
|
|
|
exists ( select 1 from xm_task t where t.menu_id=res.menu_id) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="key != null and key !='' "> and res.menu_name like #{key} </if> |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu"> |
|
|
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu"> |
|
|
select * from xm_menu res |
|
|
select * from xm_menu res |
|
|
where exists (select 1 from xm_iteration_menu im where im.menu_id in |
|
|
where exists (select 1 from xm_iteration_menu im where im.menu_id in |
|
|
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
and im.menu_id = res.menu_id ) |
|
|
|
|
|
|
|
|
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
and im.menu_id = res.menu_id ) |
|
|
</select> |
|
|
</select> |
|
|
<select id="queryTaskUsersByMenuId" parameterType="HashMap" resultType="HashMap"> |
|
|
<select id="queryTaskUsersByMenuId" parameterType="HashMap" resultType="HashMap"> |
|
|
select distinct te.userid,te.username,t.executor_userid, t.executor_username from xm_task_execuser te inner join xm_task t on t.id=te.task_id |
|
|
|
|
|
where t.menu_id=#{menuId} and te.status !='8' and te.status !='7' |
|
|
|
|
|
|
|
|
select distinct te.userid,te.username,t.executor_userid, t.executor_username from xm_task_execuser te inner join xm_task t on t.id=te.task_id |
|
|
|
|
|
where t.menu_id=#{menuId} and te.status !='8' and te.status !='7' |
|
|
</select> |
|
|
</select> |
|
|
<select id="selectListMapByWhereWithState" parameterType="HashMap" resultType="HashMap"> |
|
|
<select id="selectListMapByWhereWithState" parameterType="HashMap" resultType="HashMap"> |
|
|
select res.*,s.* from xm_menu res left join xm_menu_state s on res.menu_id=s.menu_id |
|
|
select res.*,s.* from xm_menu res left join xm_menu_state s on res.menu_id=s.menu_id |
|
|
<where> |
|
|
<where> |
|
|
<if test="ids != null"> and |
|
|
<if test="ids != null"> and |
|
|
menu_id in |
|
|
menu_id in |
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
<include refid="where"/> |
|
|
<include refid="where"/> |
|
|
<if test=' iterationFilterType=="join" '> |
|
|
<if test=' iterationFilterType=="join" '> |
|
|
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id |
|
|
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id |
|
|
<if test="iterationId!=null"> and im.iteration_id=#{iterationId}</if> |
|
|
|
|
|
|
|
|
<if test="iterationId!=null"> and im.iteration_id=#{iterationId}</if> |
|
|
) |
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
<if test='iterationFilterType=="not-join"'> |
|
|
<if test='iterationFilterType=="not-join"'> |
|
|
@ -44,9 +60,9 @@ |
|
|
<if test=' projectId !=null and projectId!="" and ( taskFilterType==null or taskFilterType=="" )'> |
|
|
<if test=' projectId !=null and projectId!="" and ( taskFilterType==null or taskFilterType=="" )'> |
|
|
and exists ( select 1 from xm_task t where t.menu_id =res.menu_id and t.project_id=#{projectId}) |
|
|
and exists ( select 1 from xm_task t where t.menu_id =res.menu_id and t.project_id=#{projectId}) |
|
|
</if> |
|
|
</if> |
|
|
<if test="compete !=null and compete!=''"> |
|
|
|
|
|
|
|
|
<if test="compete !=null and compete!=''"> |
|
|
and ( exists ( select 1 from xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id) |
|
|
and ( exists ( select 1 from xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id) |
|
|
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id) |
|
|
|
|
|
|
|
|
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id) |
|
|
) |
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
<if test="key != null and key !='' "> and res.menu_name like #{key} </if> |
|
|
<if test="key != null and key !='' "> and res.menu_name like #{key} </if> |
|
|
@ -58,10 +74,10 @@ |
|
|
<where> |
|
|
<where> |
|
|
<if test="ids != null"> and |
|
|
<if test="ids != null"> and |
|
|
menu_id in |
|
|
menu_id in |
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
<include refid="where"/> |
|
|
<include refid="where"/> |
|
|
<if test=' iterationFilterType=="join" '> |
|
|
<if test=' iterationFilterType=="join" '> |
|
|
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id |
|
|
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id |
|
|
@ -89,7 +105,8 @@ |
|
|
|
|
|
|
|
|
order by res.seq_no asc |
|
|
order by res.seq_no asc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,23 +114,9 @@ |
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
select * from xm_menu res |
|
|
select * from xm_menu res |
|
|
<where> |
|
|
|
|
|
<if test="ids != null"> and |
|
|
|
|
|
menu_id in |
|
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<where> |
|
|
|
|
|
<include refid="whereForMap"/> |
|
|
<include refid="where"/> |
|
|
<include refid="where"/> |
|
|
<if test=' iterationFilterType!=null and iterationFilterType!=""'> |
|
|
|
|
|
and <if test='iterationFilterType=="not-join"'> not </if> |
|
|
|
|
|
exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=' taskFilterType!=null and taskFilterType!="" '> |
|
|
|
|
|
and <if test='taskFilterType=="not-join"'> not </if> |
|
|
|
|
|
exists ( select 1 from xm_task t where t.menu_id=res.menu_id) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="key != null and key !='' "> and res.menu_name like #{key} </if> |
|
|
|
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
@ -146,31 +149,31 @@ |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
<!-- 新增一条记录 主键menu_id,--> |
|
|
<!-- 新增一条记录 主键menu_id,--> |
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmMenu" useGeneratedKeys="false" keyProperty="menu_id"> |
|
|
|
|
|
|
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmMenu" useGeneratedKeys="false" keyProperty="menu_id"> |
|
|
insert into xm_menu( |
|
|
insert into xm_menu( |
|
|
<include refid="columns"/> |
|
|
<include refid="columns"/> |
|
|
) values ( |
|
|
) values ( |
|
|
#{menuId},#{menuName},#{pmenuId},#{productId},#{remark},#{status},#{online},#{demandUrl},#{codeUrl},#{designUrl},#{docUrl},#{helpUrl},#{operDocUrl},#{seqNo},#{mmUserid},#{mmUsername},#{ctime} |
|
|
|
|
|
|
|
|
#{menuId},#{menuName},#{pmenuId},#{productId},#{remark},#{status},#{online},#{demandUrl},#{codeUrl},#{designUrl},#{docUrl},#{helpUrl},#{operDocUrl},#{seqNo},#{mmUserid},#{mmUsername},#{ctime},#{ntype},#{sinceVersion},#{childrenCnt},#{ltime} |
|
|
) |
|
|
) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<!-- 按条件删除若干条记录--> |
|
|
<!-- 按条件删除若干条记录--> |
|
|
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmMenu"> |
|
|
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmMenu"> |
|
|
delete from xm_menu |
|
|
|
|
|
|
|
|
delete from xm_menu res |
|
|
<where> |
|
|
<where> |
|
|
1=2 |
|
|
|
|
|
|
|
|
<include refid="where"/> |
|
|
</where> |
|
|
</where> |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<!-- 按主键删除一条记录--> |
|
|
<!-- 按主键删除一条记录--> |
|
|
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
delete from xm_menu |
|
|
|
|
|
|
|
|
delete from xm_menu |
|
|
where menu_id = #{menuId} |
|
|
where menu_id = #{menuId} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
update xm_menu |
|
|
|
|
|
|
|
|
update xm_menu |
|
|
<set> |
|
|
<set> |
|
|
<include refid="someFieldSet"/> |
|
|
<include refid="someFieldSet"/> |
|
|
</set> |
|
|
</set> |
|
|
@ -179,7 +182,7 @@ |
|
|
|
|
|
|
|
|
<!-- 根据主键修改一条记录 --> |
|
|
<!-- 根据主键修改一条记录 --> |
|
|
<update id="updateByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
<update id="updateByPk" parameterType="com.xm.core.entity.XmMenu"> |
|
|
update xm_menu |
|
|
|
|
|
|
|
|
update xm_menu |
|
|
<set> |
|
|
<set> |
|
|
<include refid="set"/> |
|
|
<include refid="set"/> |
|
|
</set> |
|
|
</set> |
|
|
@ -194,7 +197,7 @@ |
|
|
<!-- 批量更新 --> |
|
|
<!-- 批量更新 --> |
|
|
<update id="batchUpdate" parameterType="List"> |
|
|
<update id="batchUpdate" parameterType="List"> |
|
|
<foreach collection="list" item="item" index="index" separator=";" > |
|
|
<foreach collection="list" item="item" index="index" separator=";" > |
|
|
update xm_menu |
|
|
|
|
|
|
|
|
update xm_menu |
|
|
set |
|
|
set |
|
|
<include refid="batchSet"/> |
|
|
<include refid="batchSet"/> |
|
|
where menu_id = #{item.menuId} |
|
|
where menu_id = #{item.menuId} |
|
|
@ -202,20 +205,18 @@ |
|
|
</update> |
|
|
</update> |
|
|
<!-- 批量删除 --> |
|
|
<!-- 批量删除 --> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
delete from xm_menu |
|
|
|
|
|
|
|
|
delete from xm_menu |
|
|
where |
|
|
where |
|
|
(menu_id) |
|
|
|
|
|
in |
|
|
|
|
|
|
|
|
(menu_id) in |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
( #{item.menuId} |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
( #{item.menuId} ) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
<!--sql片段 列--> |
|
|
<sql id="columns"> |
|
|
<sql id="columns"> |
|
|
menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime |
|
|
|
|
|
|
|
|
menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime,ntype,since_version,children_cnt,ltime |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
@ -237,6 +238,10 @@ |
|
|
<if test="mmUserid != null and mmUserid != ''"> and res.mm_userid = #{mmUserid} </if> |
|
|
<if test="mmUserid != null and mmUserid != ''"> and res.mm_userid = #{mmUserid} </if> |
|
|
<if test="mmUsername != null and mmUsername != ''"> and res.mm_username = #{mmUsername} </if> |
|
|
<if test="mmUsername != null and mmUsername != ''"> and res.mm_username = #{mmUsername} </if> |
|
|
<if test="ctime != null"> and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') </if> |
|
|
<if test="ctime != null"> and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') </if> |
|
|
|
|
|
<if test="ntype != null and ntype != ''"> and res.ntype = #{ntype} </if> |
|
|
|
|
|
<if test="sinceVersion != null and sinceVersion != ''"> and res.since_version = #{sinceVersion} </if> |
|
|
|
|
|
<if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if> |
|
|
|
|
|
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 更新字段 --> |
|
|
<!--sql片段 更新字段 --> |
|
|
<sql id="set"> |
|
|
<sql id="set"> |
|
|
@ -255,7 +260,11 @@ |
|
|
seq_no = #{seqNo}, |
|
|
seq_no = #{seqNo}, |
|
|
mm_userid = #{mmUserid}, |
|
|
mm_userid = #{mmUserid}, |
|
|
mm_username = #{mmUsername}, |
|
|
mm_username = #{mmUsername}, |
|
|
ctime = #{ctime} |
|
|
|
|
|
|
|
|
ctime = #{ctime}, |
|
|
|
|
|
ntype = #{ntype}, |
|
|
|
|
|
since_version = #{sinceVersion}, |
|
|
|
|
|
children_cnt = #{childrenCnt}, |
|
|
|
|
|
ltime = #{ltime} |
|
|
</sql> |
|
|
</sql> |
|
|
<sql id="someFieldSet"> |
|
|
<sql id="someFieldSet"> |
|
|
<if test="menuName != null and menuName != ''"> menu_name = #{menuName}, </if> |
|
|
<if test="menuName != null and menuName != ''"> menu_name = #{menuName}, </if> |
|
|
@ -274,6 +283,10 @@ |
|
|
<if test="mmUserid != null and mmUserid != ''"> mm_userid = #{mmUserid}, </if> |
|
|
<if test="mmUserid != null and mmUserid != ''"> mm_userid = #{mmUserid}, </if> |
|
|
<if test="mmUsername != null and mmUsername != ''"> mm_username = #{mmUsername}, </if> |
|
|
<if test="mmUsername != null and mmUsername != ''"> mm_username = #{mmUsername}, </if> |
|
|
<if test="ctime != null"> ctime = #{ctime}, </if> |
|
|
<if test="ctime != null"> ctime = #{ctime}, </if> |
|
|
|
|
|
<if test="ntype != null and ntype != ''"> ntype = #{ntype}, </if> |
|
|
|
|
|
<if test="sinceVersion != null and sinceVersion != ''"> since_version = #{sinceVersion}, </if> |
|
|
|
|
|
<if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if> |
|
|
|
|
|
<if test="ltime != null"> ltime = #{ltime}, </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 批量更新 --> |
|
|
<!--sql片段 批量更新 --> |
|
|
<sql id="batchSet"> |
|
|
<sql id="batchSet"> |
|
|
@ -292,6 +305,10 @@ |
|
|
seq_no = #{item.seqNo}, |
|
|
seq_no = #{item.seqNo}, |
|
|
mm_userid = #{item.mmUserid}, |
|
|
mm_userid = #{item.mmUserid}, |
|
|
mm_username = #{item.mmUsername}, |
|
|
mm_username = #{item.mmUsername}, |
|
|
ctime = #{item.ctime} |
|
|
|
|
|
|
|
|
ctime = #{item.ctime}, |
|
|
|
|
|
ntype = #{item.ntype}, |
|
|
|
|
|
since_version = #{item.sinceVersion}, |
|
|
|
|
|
children_cnt = #{item.childrenCnt}, |
|
|
|
|
|
ltime = #{item.ltime} |
|
|
</sql> |
|
|
</sql> |
|
|
</mapper> |
|
|
</mapper> |