|
|
|
@ -3,8 +3,24 @@ |
|
|
|
<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 * from xm_menu res |
|
|
|
@ -90,6 +106,7 @@ |
|
|
|
order by res.seq_no asc |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
@ -98,22 +115,8 @@ |
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
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> |
|
|
|
<include refid="whereForMap"/> |
|
|
|
<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> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -150,15 +153,15 @@ |
|
|
|
insert into xm_menu( |
|
|
|
<include refid="columns"/> |
|
|
|
) 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> |
|
|
|
|
|
|
|
<!-- 按条件删除若干条记录--> |
|
|
|
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmMenu"> |
|
|
|
delete from xm_menu |
|
|
|
delete from xm_menu res |
|
|
|
<where> |
|
|
|
1=2 |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
</delete> |
|
|
|
|
|
|
|
@ -204,18 +207,16 @@ |
|
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
|
delete from xm_menu |
|
|
|
where |
|
|
|
(menu_id) |
|
|
|
in |
|
|
|
(menu_id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
( #{item.menuId} |
|
|
|
) |
|
|
|
( #{item.menuId} ) |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
|
<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片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
|
@ -237,6 +238,10 @@ |
|
|
|
<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="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 id="set"> |
|
|
|
@ -255,7 +260,11 @@ |
|
|
|
seq_no = #{seqNo}, |
|
|
|
mm_userid = #{mmUserid}, |
|
|
|
mm_username = #{mmUsername}, |
|
|
|
ctime = #{ctime} |
|
|
|
ctime = #{ctime}, |
|
|
|
ntype = #{ntype}, |
|
|
|
since_version = #{sinceVersion}, |
|
|
|
children_cnt = #{childrenCnt}, |
|
|
|
ltime = #{ltime} |
|
|
|
</sql> |
|
|
|
<sql id="someFieldSet"> |
|
|
|
<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="mmUsername != null and mmUsername != ''"> mm_username = #{mmUsername}, </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 id="batchSet"> |
|
|
|
@ -292,6 +305,10 @@ |
|
|
|
seq_no = #{item.seqNo}, |
|
|
|
mm_userid = #{item.mmUserid}, |
|
|
|
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> |
|
|
|
</mapper> |