0ee986ad 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 34270323 9551780d
......@@ -81,7 +81,7 @@ public class DangerLevelManageController {
Result<IPage<DangerLevelManage>> result = new Result<IPage<DangerLevelManage>>();
QueryWrapper<DangerLevelManage> queryWrapper = QueryGenerator.initQueryWrapper(dangerLevelManage, req.getParameterMap());
Page<DangerLevelManage> page = new Page<DangerLevelManage>(pageNo, pageSize);
IPage<DangerLevelManage> pageList = dangerLevelManageService.page(page, queryWrapper);
IPage<DangerLevelManage> pageList = dangerLevelManageService.queryPage(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
......@@ -197,7 +197,9 @@ public class DangerLevelManageController {
DangerLevelManageShare dangerLevelManageShare = new DangerLevelManageShare();
BeanUtils.copyProperties(dangerLevelManage , dangerLevelManageShare);
dangerLevelManageShareService.save( dangerLevelManageShare ) ;
}
}else{
dangerLevelManageShareService.removeById( dangerLevelManage.getId()) ;//如果不分享,就删除记录
}
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
......
......@@ -68,6 +68,12 @@ public class DangerLevelManage{
@Excel(name = "管控措施", width = 15)
@ApiModelProperty(value = "管控措施")
private String dangerWay;
/**管控措施*/
@Excel(name = "检查频次(H)", width = 15)
@ApiModelProperty(value = "检查频次(H)")
private String frequency;
/**管控层级*/
@Excel(name = "管控层级", width = 15,dicCode = "dangerRank")
@ApiModelProperty(value = "管控层级")
......@@ -141,22 +147,29 @@ public class DangerLevelManage{
@ApiModelProperty(value = "关联设备名称")
private String equipmentName;
@TableField(exist=false)
@ApiModelProperty(value = "风险等级名称")
private String dangerLevelName;
@TableField(exist=false)
@ApiModelProperty(value = "风险类型名称")
private String dangerTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "风险位置名称")
private String dangerPlaceName;
@TableField(exist=false)
@ApiModelProperty(value = "检查内容@分割")
private String inspectContent;
@TableField(exist=false)
@ApiModelProperty(value = "隐患数量")
private String inspectionNum;
@TableField(exist=false)
@ApiModelProperty(value = "异常巡检数量")
private String rectificationNum;
......
......@@ -65,6 +65,11 @@ public class DangerLevelManageShare {
@Excel(name = "管控措施", width = 15)
@ApiModelProperty(value = "管控措施")
private String dangerWay;
/**管控措施*/
@Excel(name = "检查频次(H)", width = 15)
@ApiModelProperty(value = "检查频次(H)")
private String frequency;
/**管控层级*/
@Excel(name = "管控层级", width = 15,dicCode = "dangerRank")
@ApiModelProperty(value = "管控层级")
......
......@@ -2,9 +2,12 @@ package com.skua.modules.safe.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
/**
* 风险分级管控清单
......@@ -17,4 +20,12 @@ public interface DangerLevelManageMapper extends BaseMapper<DangerLevelManage> {
* @return
*/
public DangerLevelManage queryById(@Param("id") String id);
//List<DangerLevelManage> queryByList(Page page, @Param("param") DangerLevelManage dangerLevelManage);
@Select("SELECT t.*,ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num' " +
" FROM danger_level_manage t" +
" left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id " +
" left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id " +
" left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}")
List<DangerLevelManage> getListByWrapper(Page page,@Param("ew") QueryWrapper<DangerLevelManage> queryWrapper);
}
......
......@@ -12,4 +12,30 @@
left join sys_struct_dict sd on sd.id = m.danger_place
where m.id = #{id}
</select>
</mapper>
\ No newline at end of file
<select id="queryByList" resultType="com.skua.modules.safe.entity.DangerLevelManage">
select ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num', t.* from danger_level_manage t
left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id
left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id
left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id
<where>
<if test="param.departId != null and param.departId != ''"> and t.depart_id = #{param.departId}</if>
<if test="param.dangerType != null and param.dangerType != ''"> and t.danger_type = #{param.dangerType}</if>
<if test="param.dangerName != null and param.dangerName != ''"> and t.danger_name like concat('%', #{param.dangerName}, '%')</if>
<if test="param.dangerContent != null and param.dangerContent != ''"> and t.danger_content = #{param.dangerContent}</if>
<if test="param.dangerStandard != null and param.dangerStandard != ''"> and t.danger_standard = #{param.dangerStandard}</if>
<if test="param.dangerLevel != null and param.dangerLevel != ''"> and t.danger_level = #{param.dangerLevel}</if>
<if test="param.dangerResult != null and param.dangerResult != ''"> and t.danger_result = #{param.dangerResult}</if>
<if test="param.dangerWay != null and param.dangerWay != ''"> and t.danger_way = #{param.dangerWay}</if>
<if test="param.dangerRank != null and param.dangerRank != ''"> and t.danger_rank = #{param.dangerRank}</if>
<if test="param.dangerDept != null and param.dangerDept != ''"> and t.danger_dept = #{param.dangerDept}</if>
<if test="param.dangerUser != null and param.dangerUser != ''"> and t.danger_user = #{param.dangerUser}</if>
<if test="param.dangerFour != null and param.dangerFour != ''"> and t.danger_four = #{param.dangerFour}</if>
<if test="param.dangerPlace != null and param.dangerPlace != ''"> and t.danger_place = #{param.dangerPlace}</if>
<if test="param.equipInfoId != null and param.equipInfoId != ''"> and t.equip_info_id = #{param.equipInfoId}</if>
<if test="param.share != null and param.share != ''"> and share = #{param.share}</if>
<if test="param.frequency != null and param.frequency != ''"> and frequency = #{param.frequency}</if>
</where>
</select>
</mapper>
......
package com.skua.modules.safe.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.entity.AjhMeetingSend;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -14,4 +18,12 @@ public interface IDangerLevelManageService extends IService<DangerLevelManage> {
* @return
*/
public DangerLevelManage queryById(String id);
/***
* 分页检索
* @param page
* @param queryWrapper
* @return
*/
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper) ;
}
......
package com.skua.modules.safe.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.entity.AjhMeetingSend;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.mapper.DangerLevelManageMapper;
import com.skua.modules.safe.service.IDangerLevelManageService;
......@@ -24,4 +28,16 @@ public class DangerLevelManageServiceImpl extends ServiceImpl<DangerLevelManageM
public DangerLevelManage queryById(String id){
return this.baseMapper.queryById(id);
}
/***
* 分页检索
* @param page
* @param queryWrapper
* @return
*/
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper) {
List<DangerLevelManage> list = this.baseMapper.getListByWrapper(page, queryWrapper);
page.setRecords(list);
return page;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!