|
|
|
@ -11,10 +11,82 @@ |
|
|
|
( #{item}) |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="key != null and key !='' "> </if> |
|
|
|
<if test=" pidPathsList != null"> and |
|
|
|
<foreach collection="pidPathsList" item="item" index="index" open="(" separator=" or " close=")" > |
|
|
|
#{item} like concat(res.pid_paths,'%') |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" tagIdList != null"> and |
|
|
|
<foreach collection="tagIdList" item="item" index="index" open="(" separator=" or " close=")" > |
|
|
|
find_in_set(#{item},res.tag_ids) |
|
|
|
</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> |
|
|
|
<if test="isTop!=null and isTop!=''"> and (res.pmenu_id is null or res.pmenu_id = '')</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu"> |
|
|
|
select * from xm_menu res |
|
|
|
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 ) |
|
|
|
</select> |
|
|
|
<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> |
|
|
|
<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 |
|
|
|
<where> |
|
|
|
<include refid="whereForMap"/> |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
order by res.seq_no asc |
|
|
|
</select> |
|
|
|
<select id="selectListMapByWhereWithPlan" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select res.*,plan.* from xm_menu res left join xm_menu_plan plan on res.menu_id=plan.menu_id and plan.project_id=#{projectId} |
|
|
|
<where> |
|
|
|
<include refid="whereForMap"/> |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
|
|
|
|
order by res.seq_no asc |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateMenuChildrenCntByMenuId" parameterType="String"> |
|
|
|
UPDATE xm_menu t |
|
|
|
LEFT JOIN ( SELECT count( 1 ) AS children_cnt, tt.pmenu_id AS menu_id FROM xm_menu tt WHERE tt.pmenu_id = #{menuId} ) t2 ON t2.menu_id = t.menu_id |
|
|
|
SET t.children_cnt = ifnull( t2.children_cnt, 0 ) |
|
|
|
WHERE |
|
|
|
t.menu_id = #{menuId} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateChildrenCntByIds" parameterType="List"> |
|
|
|
UPDATE xm_menu t |
|
|
|
LEFT JOIN ( SELECT count( 1 ) AS children_cnt, tt.pmenu_id AS menu_id FROM xm_menu tt WHERE |
|
|
|
(tt.pmenu_id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
( #{item}) |
|
|
|
</foreach> |
|
|
|
group by tt.pmenu_id ) t2 ON t2.menu_id = t.menu_id |
|
|
|
SET t.children_cnt = ifnull( t2.children_cnt, 0 ) |
|
|
|
WHERE (t.menu_id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
( #{item}) |
|
|
|
</foreach> |
|
|
|
</update> |
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
|