陈裕财 2 years ago
parent
commit
276db1df74
  1. 6
      xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java
  2. 1
      xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml
  3. 2
      xm-core/src/main/java/com/xm/core/mapper/XmProductMapper.java
  4. 22
      xm-core/src/main/java/com/xm/core/mapper/XmProductMapper.xml
  5. 3
      xm-core/src/main/java/com/xm/core/mapper/XmWorkloadMapper.xml
  6. 5
      xm-core/src/main/java/com/xm/core/service/XmProductService.java

6
xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java

@ -176,8 +176,10 @@ public class XmProductController {
} }
params.put("platformBranchId",platformBranchId); params.put("platformBranchId",platformBranchId);
params.put("linkBranchId",user.getBranchId()); params.put("linkBranchId",user.getBranchId());
List<Map<String,Object>> datas = xmProductService.selectListMapByWhereWithState(params); //列出XmProduct列表
return Result.ok().setData(datas).setTotal(page.getTotal());
QueryWrapper<XmProduct> qw = QueryTools.initQueryWrapper(XmProduct.class , params);
List<Map<String,Object>> datas = xmProductService.selectListMapByWhereWithState(page,qw,params);
return Result.ok().setData(datas).setTotal(page.getTotal());
} }
/***/ /***/

1
xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml

@ -20,7 +20,6 @@
<if test=" createTimeEnd !=null "> and res.ctime &lt; #{createTimeEnd} </if> <if test=" createTimeEnd !=null "> and res.ctime &lt; #{createTimeEnd} </if>
<if test=" onlineTimeStart !=null "> and res.online_time &gt; #{onlineTimeStart} </if> <if test=" onlineTimeStart !=null "> and res.online_time &gt; #{onlineTimeStart} </if>
<if test=" onlineTimeEnd !=null "> and res.online_time &lt; #{onlineTimeEnd} </if> <if test=" onlineTimeEnd !=null "> and res.online_time &lt; #{onlineTimeEnd} </if>
<include refid="where"/>
<if test=" ( menuId != null and menuId !='')"> <if test=" ( menuId != null and menuId !='')">
and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId} and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if> <if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>

2
xm-core/src/main/java/com/xm/core/mapper/XmProductMapper.java

@ -23,6 +23,6 @@ public interface XmProductMapper extends BaseMapper<XmProduct> {
*/ */
List<Map<String,Object>> selectListMapByWhere(IPage page, @Param("ew") QueryWrapper ew,@Param("ext") Map<String,Object> ext); List<Map<String,Object>> selectListMapByWhere(IPage page, @Param("ew") QueryWrapper ew,@Param("ext") Map<String,Object> ext);
List<Map<String, Object>> selectListMapByWhereWithState(Map<String, Object> iterationMap);
List<Map<String, Object>> selectListMapByWhereWithState(IPage page, @Param("ew") QueryWrapper ew,@Param("ext") Map<String,Object> ext);
} }

22
xm-core/src/main/java/com/xm/core/mapper/XmProductMapper.xml

@ -5,12 +5,12 @@
<select id="selectListMapByWhere" resultType="HashMap"> <select id="selectListMapByWhere" resultType="HashMap">
select * from xm_product res select * from xm_product res
<if test="ext.linkProjectId !=null and ext.linkProjectId!=''"> <if test="ext.linkProjectId !=null and ext.linkProjectId!=''">
inner join xm_product_project_link ppl on res.id=ppl.product_id and ext.ppl.project_id=#{ext.linkProjectId}
inner join xm_product_project_link ppl on res.id=ppl.product_id and ppl.project_id=#{ext.linkProjectId}
</if> </if>
<where> <where>
${@com.mdp.Util@trimWhere(ew.customSqlSegment)} ${@com.mdp.Util@trimWhere(ew.customSqlSegment)}
<!--下面可以添加更多查询条件,正常的if 条件都是支持的--> <!--下面可以添加更多查询条件,正常的if 条件都是支持的-->
<include refid="whereForMap"></include>
</where> </where>
<!--下面双引号内可以添加默认排序,如果前端没有上传排序,将使用引号内的排序规则--> <!--下面双引号内可以添加默认排序,如果前端没有上传排序,将使用引号内的排序规则-->
@ -22,26 +22,26 @@
</if> </if>
</select> </select>
<sql id="whereForMap"> <sql id="whereForMap">
<if test="ext.key != null and ext.key !='' "> and ext.res.product_name like concat('%',#{ext.key} ,'%') </if>
<if test="ext.key != null and ext.key !='' "> and res.product_name like concat('%',#{ext.key} ,'%') </if>
<if test="ext.linkIterationId !=null and ext.linkIterationId!=''"> <if test="ext.linkIterationId !=null and ext.linkIterationId!=''">
and ext.exists( select 1 from xm_iteration ppl where ppl.product_id=res.id and ext.ppl.id=#{ext.linkIterationId} )
and exists( select 1 from xm_iteration ppl where ppl.product_id=res.id and ppl.id=#{ext.linkIterationId} )
</if> </if>
<if test="ext.compete !=null and ext.compete!=''"> <if test="ext.compete !=null and ext.compete!=''">
and ext.( exists ( select 1 from xm_group_user gu inner join xm_product_project_link t on (gu.project_id=t.project_id or gu.product_id=t.product_id ) and ext.t.product_id=res.id where gu.userid=#{ext.compete} and ext.t.product_id=res.id )
and ( exists ( select 1 from xm_group_user gu inner join xm_product_project_link t on (gu.project_id=t.project_id or gu.product_id=t.product_id ) and t.product_id=res.id where gu.userid=#{ext.compete} and t.product_id=res.id )
or res.pm_userid=#{ext.compete} or res.adm_userid=#{ext.compete} or res.ass_userid=#{ext.compete} or res.pm_userid=#{ext.compete} or res.adm_userid=#{ext.compete} or res.ass_userid=#{ext.compete}
) )
</if> </if>
<if test="ext.ctimeStart!=null and ext.ctimeEnd!=null ">and ext.ctime between #{ext.ctimeStart} and ext.#{ext.ctimeEnd}</if>
<if test="ext.ctimeStart!=null and ext.ctimeEnd!=null ">and ctime between #{ext.ctimeStart} and #{ext.ctimeEnd}</if>
<if test="ext.isTpl!=null and ext.isTpl=='1'"> <if test="ext.isTpl!=null and ext.isTpl=='1'">
and ext.(res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and ext.res.is_tpl='1')
and (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and res.is_tpl='1')
</if> </if>
<if test="ext.del==null or del==''"> <if test="ext.del==null or del==''">
and ext.res.del!="1"
and res.del!="1"
</if> </if>
<if test="ext.linkBranchId!=null and ext.linkBranchId!=''"> <if test="ext.linkBranchId!=null and ext.linkBranchId!=''">
and ext.( res.branch_id = #{ext.linkBranchId}
and ( res.branch_id = #{ext.linkBranchId}
<if test="ext.isTpl!=null and ext.isTpl=='1'"> <if test="ext.isTpl!=null and ext.isTpl=='1'">
or (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and ext.res.is_tpl='1')
or (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and res.is_tpl='1')
</if> </if>
) )
@ -51,7 +51,7 @@
<select id="selectListMapByWhereWithState" parameterType="HashMap" resultType="HashMap"> <select id="selectListMapByWhereWithState" parameterType="HashMap" resultType="HashMap">
select res.*,s.* from xm_product res left join xm_product_state s on res.id=s.product_id select res.*,s.* from xm_product res left join xm_product_state s on res.id=s.product_id
<if test="ext.linkProjectId !=null and ext.linkProjectId!=''"> <if test="ext.linkProjectId !=null and ext.linkProjectId!=''">
inner join xm_product_project_link ppl on res.id=ppl.product_id and ext.ppl.project_id=#{ext.linkProjectId}
inner join xm_product_project_link ppl on res.id=ppl.product_id and ppl.project_id=#{ext.linkProjectId}
</if> </if>
<where> <where>
<include refid="whereForMap"/> <include refid="whereForMap"/>

3
xm-core/src/main/java/com/xm/core/mapper/XmWorkloadMapper.xml

@ -75,7 +75,6 @@
from xm_workload res from xm_workload res
<where> <where>
<include refid="whereForMap"/> <include refid="whereForMap"/>
<include refid="where"/>
</where> </where>
group by res.biz_date group by res.biz_date
order by res.biz_date asc order by res.biz_date asc
@ -96,7 +95,6 @@
from xm_workload res from xm_workload res
<where> <where>
<include refid="whereForMap"/> <include refid="whereForMap"/>
<include refid="where"/>
</where> </where>
group by biz_month group by biz_month
order by biz_month asc order by biz_month asc
@ -128,7 +126,6 @@
from xm_workload res from xm_workload res
<where> <where>
<include refid="whereForMap"/> <include refid="whereForMap"/>
<include refid="where"/>
</where> </where>
group by res.project_id,res.task_id,res.userid group by res.project_id,res.task_id,res.userid
) as res on res.task_id = task.id ) as res on res.task_id = task.id

5
xm-core/src/main/java/com/xm/core/service/XmProductService.java

@ -88,11 +88,10 @@ public class XmProductService extends BaseService<XmProductMapper,XmProduct> {
/** /**
* 连同产品关联的状态数据一起带出 * 连同产品关联的状态数据一起带出
* @param iterationMap
* @return * @return
*/ */
public List<Map<String, Object>> selectListMapByWhereWithState(Map<String, Object> iterationMap) {
return baseMapper.selectListMapByWhereWithState( iterationMap);
public List<Map<String, Object>> selectListMapByWhereWithState(IPage page, QueryWrapper ew, Map<String,Object> ext) {
return baseMapper.selectListMapByWhereWithState( page,ew,ext);
} }
@Transactional @Transactional

Loading…
Cancel
Save