update code
parent
003921c7b3
commit
f0ddfdc118
|
@ -45,4 +45,25 @@ public class BgWorkTrainController extends BaseController {
|
|||
return getDataTable(workTrainService.selectBgscreenWorkTrainListv2(workTrain));
|
||||
}
|
||||
|
||||
/**
|
||||
* 大屏教训培训,应急演练图标数据查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getGroupByDataType")
|
||||
public AjaxResult getGroupByDataType(String deptId, String projectId){
|
||||
WorkTrain workTrain = new WorkTrain();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
workTrain.setNowDept(deptId);
|
||||
}else{
|
||||
if (SecurityUtils.isUserB()) {
|
||||
workTrain.setPrjIds(getProjectIds());
|
||||
}
|
||||
}
|
||||
if(projectId!=null && !"0".equals(projectId)){
|
||||
workTrain.setProjectId(Convert.toLong(projectId));
|
||||
}
|
||||
return AjaxResult.success(workTrainService.getGroupByDataType(workTrain));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -118,4 +118,6 @@ public interface WorkTrainMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
|
||||
|
||||
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain);
|
||||
}
|
||||
|
|
|
@ -92,4 +92,6 @@ public interface IWorkTrainService
|
|||
* @return 结果
|
||||
*/
|
||||
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
|
||||
|
||||
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain);
|
||||
}
|
||||
|
|
|
@ -220,4 +220,9 @@ public class WorkTrainServiceImpl implements IWorkTrainService
|
|||
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId) {
|
||||
return workTrainMapper.findGroupCountByProjectId(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain) {
|
||||
return workTrainMapper.getGroupByDataType(workTrain);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateWorkTrain" parameterType="WorkTrain">
|
||||
update work_train
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
@ -252,4 +253,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
( #{item.trainId}, #{item.deptId}, #{item.isMain})
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getGroupByDataType" parameterType="WorkTrain" resultMap="WorkTrainResult">
|
||||
SELECT a.dict_value data_type,dict_label train_title,css_class train_type,b.cnt id
|
||||
FROM (
|
||||
SELECT *
|
||||
FROM sys_dict_data WHERE dict_type='work_train_data_type' ) a
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT COUNT(1) cnt,data_type
|
||||
FROM work_train
|
||||
<where>
|
||||
<if test="projectId != null"> and project_id = #{projectId}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY data_type
|
||||
) b ON a.dict_value=b.data_type
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue