diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmGroupMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmGroupMapper.xml index 00f47340..74889937 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmGroupMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmGroupMapper.xml @@ -16,7 +16,7 @@ exists ( select 1 from xm_group_user gu where gu.group_id=res.id and gu.username like concat('%',#{groupUsernameKey},'%')) and (res.branch_id=#{branchId} or res.crow_branch_id=#{orCrowBranchId}) - and exists ( select 1 from xm_iteration_link ipl where (ipl.pro_id = res.product_id and ipl.ltype='1') or (ipl.pro_id=res.project_id and ipl.ltype='0')) + and exists ( select 1 from xm_iteration ipl inner join xm_product_project_link ppl on ipl.product_id=ppl.product_id where (ipl.product_id = res.product_id or ppl.project_id=res.project_id) delete from xm_group where project_id = #{projectId} diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml index f0ee9c4c..2671d16c 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml @@ -27,15 +27,9 @@ and im.product_id=#{productId} ) - - - and exists ( select 1 from xm_iteration_link ipl - where ipl.iteration_id=res.id and ipl.pro_id=#{productId} - ) - - and exists( select 1 from xm_iteration_link ipl - where ipl.pro_id=#{projectId} and ipl.iteration_id =res.id + and exists( select 1 from xm_product_project_link ppl + where ppl.project_id=#{projectId} and ppl.product_id =res.product_id )