Commit dbda0d9e authored by 陈晓晋's avatar 陈晓晋

巡查记录和详情20240111巡查记录和详情2024011101

parent 35b60965
package com.censoft.censoftrongtong.controller;
import com.censoft.censoftrongtong.domain.CurrentRiskDetailAbnormal;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolDetail;
import com.censoft.censoftrongtong.domain.RiskPlanExistingList;
import com.censoft.censoftrongtong.service.ICurrentRiskDetailAbnormalService;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolDetailService;
import com.censoft.censoftrongtong.service.IRiskPlanExistingListService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
......@@ -13,6 +17,7 @@ import com.ruoyi.system.service.ISysUploadFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -34,6 +39,11 @@ public class CurrentRiskDetailAbnormalController extends BaseController
{
@Autowired
private ICurrentRiskDetailAbnormalService currentRiskDetailAbnormalService;
@Autowired
private ICurrentRiskUserPatrolDetailService currentRiskUserPatrolDetailService;
@Autowired
private IRiskPlanExistingListService riskPlanExistingListService;
@Resource
private ISysUploadFileService uploadFileService;
......@@ -46,7 +56,6 @@ public class CurrentRiskDetailAbnormalController extends BaseController
/**
* 查询现状风险巡查异常信息列表
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskAbnormal:list')")
@GetMapping("/list")
public TableDataInfo list(CurrentRiskDetailAbnormal currentRiskDetailAbnormal)
{
......@@ -58,7 +67,6 @@ public class CurrentRiskDetailAbnormalController extends BaseController
/**
* 导出现状风险巡查异常信息列表
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskAbnormal:export')")
@Log(title = "现状风险巡查异常信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskDetailAbnormal currentRiskDetailAbnormal)
......@@ -71,7 +79,6 @@ public class CurrentRiskDetailAbnormalController extends BaseController
/**
* 获取现状风险巡查异常信息详细信息
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskAbnormal:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
......@@ -81,7 +88,6 @@ public class CurrentRiskDetailAbnormalController extends BaseController
/**
* 新增现状风险巡查异常信息
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskAbnormal:add11')")
@Log(title = "现状风险巡查异常信息", businessType = BusinessType.INSERT)
@PostMapping("/save1")
public AjaxResult add1(@RequestBody CurrentRiskDetailAbnormal currentRiskDetailAbnormal)
......@@ -95,8 +101,10 @@ public class CurrentRiskDetailAbnormalController extends BaseController
// @PreAuthorize("@ss.hasPermi('risk:currentRiskAbnormal:add')")
@Log(title = "现状风险巡查异常信息", businessType = BusinessType.INSERT)
@PostMapping("/save")
@Transactional
public AjaxResult add( CurrentRiskDetailAbnormal currentRiskDetailAbnormal , @RequestParam(value = "file[]", required = false) MultipartFile[] file)
{
CurrentRiskUserPatrolDetail detail= currentRiskUserPatrolDetailService.selectCurrentRiskUserPatrolDetailById(currentRiskDetailAbnormal.getPatrolDetailId());
if (file != null) {
String userId = getUserId() + "";
String pictureFileIds = Arrays.stream(file)
......@@ -105,7 +113,20 @@ public class CurrentRiskDetailAbnormalController extends BaseController
.collect(Collectors.joining(","));
currentRiskDetailAbnormal.setAbnormalPics(pictureFileIds);
}
return toAjax(currentRiskDetailAbnormalService.insertCurrentRiskDetailAbnormal(currentRiskDetailAbnormal));
int rs=currentRiskDetailAbnormalService.insertCurrentRiskDetailAbnormal(currentRiskDetailAbnormal);
if (rs>0) {
//重新评估风险 ---修改现状风险分数和等级
RiskPlanExistingList risk=new RiskPlanExistingList();
risk.setId(detail.getCurrentRiskId());
risk.setLevelScore(currentRiskDetailAbnormal.getScore());
riskPlanExistingListService.updateRiskPlanExistingList(risk);
riskPlanExistingListService.getRiskLevelByScoreAndUpd(currentRiskDetailAbnormal.getBuildingId(),currentRiskDetailAbnormal.getScore());
//修改异常状态
detail.setStatus("1");
currentRiskUserPatrolDetailService.updateCurrentRiskUserPatrolDetail(detail);
}
return toAjax(rs);
}
/**
......
......@@ -5,12 +5,14 @@ import com.censoft.censoftrongtong.domain.CurrentRiskPostList;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolDetail;
import com.censoft.censoftrongtong.enums.CycleType;
import com.censoft.censoftrongtong.service.*;
import com.censoft.censoftrongtong.service.ICommonMessageInfoService;
import com.censoft.censoftrongtong.service.ICurrentRiskPostListService;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolDetailService;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISysUserService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
......@@ -118,7 +120,7 @@ public class CurrentRiskTask {
commonMessageInfoService.insertBacklogInfo(String.valueOf(currentRiskUserPatrol.getId()), "risk_confirm_sub", String.valueOf(currentRiskUserPatrol.getId()),
"巡查任务", "巡查",
"您有一条新的巡查任务待确认", "0", user.getUserName(),
"巡查任务", "" , "patrolExecute", user.getNickName());
"巡查任务", "patrolExecute" , "patrolExecute", user.getUserName());
}
}
......
......@@ -12,10 +12,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.system.service.ISysUserService;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
......@@ -83,7 +81,6 @@ public class CurrentRiskUserHolidayController extends BaseController {
/**
* 导出现状风险巡查用户请假列表
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:export')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskUserHoliday currentRiskUserHoliday) {
......@@ -95,7 +92,6 @@ public class CurrentRiskUserHolidayController extends BaseController {
/**
* 获取现状风险巡查用户请假详细信息
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(currentRiskUserHolidayService.selectCurrentRiskUserHolidayById(id));
......@@ -104,7 +100,6 @@ public class CurrentRiskUserHolidayController extends BaseController {
/**
* 新增现状风险巡查用户请假
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:add')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.INSERT)
@PostMapping("/save")
public AjaxResult add(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) {
......@@ -130,7 +125,6 @@ public class CurrentRiskUserHolidayController extends BaseController {
/**
* 修改现状风险巡查用户请假
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:edit')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) {
......@@ -140,7 +134,6 @@ public class CurrentRiskUserHolidayController extends BaseController {
/**
* 删除现状风险巡查用户请假
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:remove')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
......
package com.censoft.censoftrongtong.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.censoft.censoftrongtong.domain.CurrentRiskDetailAbnormal;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol;
......@@ -13,12 +14,15 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysUploadFileService;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 巡查执行管理Controller
......@@ -33,6 +37,9 @@ public class CurrentRiskUserPatrolController extends BaseController {
private ICurrentRiskUserPatrolService currentRiskUserPatrolService;
private ICurrentRiskDetailAbnormalService currentRiskDetailAbnormalService;
@Resource
private ISysUploadFileService uploadFileService;
@GetMapping("/getPatrolProjectList")
public AjaxResult getPatrolProjectList() {
......@@ -51,10 +58,17 @@ public class CurrentRiskUserPatrolController extends BaseController {
return getDataTable(list);
}
@GetMapping("/detailList")
public TableDataInfo detailList(CurrentRiskUserPatrol currentRiskUserPatrol) {
startPage();
List<CurrentRiskUserPatrolVO> list = currentRiskUserPatrolService.selectCurrentRiskUserPatrolDetailList(currentRiskUserPatrol);
return getDataTable(list);
}
/**
* 导出巡查执行管理列表
*/
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:export')")
@Log(title = "巡查执行管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskUserPatrol currentRiskUserPatrol) {
......@@ -66,7 +80,6 @@ public class CurrentRiskUserPatrolController extends BaseController {
/**
* 获取巡查执行管理详细信息
*/
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(currentRiskUserPatrolService.selectCurrentRiskUserPatrolById(id));
......@@ -82,8 +95,14 @@ public class CurrentRiskUserPatrolController extends BaseController {
if(currentRiskUserPatrolVO != null){
if (currentRiskUserPatrolVO.getExceptStatus()!=null&&currentRiskUserPatrolVO.getExceptStatus().equals("1")) {//如果有异常信息加入详情
QueryWrapper<CurrentRiskDetailAbnormal> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CurrentRiskDetailAbnormal::getPatrolId,id);
queryWrapper.lambda().eq(CurrentRiskDetailAbnormal::getPatrolId,currentRiskUserPatrolVO.getId());
CurrentRiskDetailAbnormal currentRiskDetailAbnormal= currentRiskDetailAbnormalService.getOne(queryWrapper);
if (!StrUtil.hasEmpty(currentRiskDetailAbnormal.getAbnormalPics())) {
List<Long> fileIds = Arrays.stream(currentRiskDetailAbnormal.getAbnormalPics().split(","))
.map(Long::parseLong)
.collect(Collectors.toList());
currentRiskDetailAbnormal.setFiles(uploadFileService.selectSysFileByFileIds(fileIds));
}
if (currentRiskDetailAbnormal!=null) {
currentRiskUserPatrolVO.setCurrentailAbnormal(currentRiskDetailAbnormal);
}
......@@ -95,7 +114,6 @@ public class CurrentRiskUserPatrolController extends BaseController {
/**
* 新增巡查执行管理
*/
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:add')")
@Log(title = "巡查执行管理", businessType = BusinessType.INSERT)
@PostMapping("save")
public AjaxResult add(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) {
......@@ -105,7 +123,6 @@ public class CurrentRiskUserPatrolController extends BaseController {
/**
* 修改巡查执行管理
*/
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:edit')")
@Log(title = "巡查执行管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) {
......@@ -115,7 +132,6 @@ public class CurrentRiskUserPatrolController extends BaseController {
/**
* 删除巡查执行管理
*/
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:remove')")
@Log(title = "巡查执行管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
......
package com.censoft.censoftrongtong.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolDetail;
import com.censoft.censoftrongtong.domain.RiskExistingListPatrolVO;
import com.censoft.censoftrongtong.domain.req.CurrentRiskUserPatrolDetailUpdateStatusReqVO;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolDetailService;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolService;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolDetail;
import com.censoft.censoftrongtong.service.ICurrentRiskUserPatrolDetailService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 现状风险用户巡查明细Controller
......@@ -50,7 +41,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 查询现状风险用户巡查明细列表
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:list')")
@GetMapping("/list")
public TableDataInfo list(CurrentRiskUserPatrolDetail currentRiskUserPatrolDetail)
{
......@@ -101,7 +91,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 导出现状风险用户巡查明细列表
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:export')")
@Log(title = "现状风险用户巡查明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskUserPatrolDetail currentRiskUserPatrolDetail)
......@@ -114,7 +103,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 获取现状风险用户巡查明细详细信息
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
......@@ -124,7 +112,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 新增现状风险用户巡查明细
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:add')")
@Log(title = "现状风险用户巡查明细", businessType = BusinessType.INSERT)
@PostMapping("save")
public AjaxResult add(@RequestBody CurrentRiskUserPatrolDetail currentRiskUserPatrolDetail)
......@@ -135,7 +122,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 修改现状风险用户巡查明细
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:edit')")
@Log(title = "现状风险用户巡查明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CurrentRiskUserPatrolDetail currentRiskUserPatrolDetail)
......@@ -146,7 +132,6 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
/**
* 删除现状风险用户巡查明细
*/
@PreAuthorize("@ss.hasPermi('risk:currentRiskPatrolDetail:remove')")
@Log(title = "现状风险用户巡查明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
......
package com.censoft.censoftrongtong.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntityClean;
import com.ruoyi.system.domain.SysUploadFile;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 现状风险巡查异常信息对象 current_risk_detail_abnormal
*
......@@ -26,6 +31,16 @@ public class CurrentRiskDetailAbnormal extends BaseEntityClean
@Excel(name = "巡查明细id")
private Long patrolDetailId;
/**
*
*/
@TableField(exist = false)
private Long buildingId;
@TableField(exist = false)
private BigDecimal score;
/** 巡查内容 */
@Excel(name = "巡查内容")
private String riskContent;
......@@ -52,4 +67,8 @@ public class CurrentRiskDetailAbnormal extends BaseEntityClean
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 文件ids */
@TableField(exist = false)
private List<SysUploadFile> files;
}
package com.censoft.censoftrongtong.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntityClean;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 现状风险巡查用户请假对象 current_risk_user_holiday
......@@ -23,6 +22,8 @@ public class CurrentRiskUserHoliday extends BaseEntityClean
private static final long serialVersionUID = 1L;
/** 主键 id */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 申请人用户 id */
......
package com.censoft.censoftrongtong.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.util.Date;
......@@ -48,7 +50,7 @@ public class CurrentRiskUserPatrolVO
/**
* 巡查信息
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private Long userId;
......
......@@ -12,6 +12,8 @@ import java.util.Map;
@Data
public class CurrentRiskUserPatrolDetailUpdateStatusReqVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty
private List<Map<String,Object>> list;
......
......@@ -30,6 +30,7 @@ public interface CurrentRiskUserPatrolMapper extends MPJBaseMapper<CurrentRiskU
* @return 巡查执行管理
*/
public CurrentRiskUserPatrolVO selectCurrentRiskUserPatrolDetail(Long id);
public List<CurrentRiskUserPatrolVO> selectCurrentRiskUserPatrolDetailList(CurrentRiskUserPatrol currentRiskUserPatrol);
/**
* 根据用户id获取巡检项目
......
......@@ -31,6 +31,7 @@ public interface ICurrentRiskUserPatrolService extends MPJBaseService<CurrentRi
* @return 巡查执行管理
*/
public CurrentRiskUserPatrolVO selectCurrentRiskUserPatrolDetail(Long id);
public List<CurrentRiskUserPatrolVO> selectCurrentRiskUserPatrolDetailList(CurrentRiskUserPatrol currentRiskUserPatrol);
/**
* 查询巡查执行管理列表
......
......@@ -8,9 +8,11 @@ import com.ruoyi.system.domain.MessageInfo;
import com.ruoyi.system.mapper.BacklogInfoMapper;
import com.ruoyi.system.mapper.MessageInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service
public class CommonMessageInfoServiceImpl implements ICommonMessageInfoService {
@Autowired
private MessageInfoMapper messageInfoMapper;
......
......@@ -47,6 +47,15 @@ public class CurrentRiskUserPatrolServiceImpl extends MPJBaseServiceImpl<Current
return currentRiskUserPatrolMapper.selectCurrentRiskUserPatrolDetail(id);
}
@Override
public List<CurrentRiskUserPatrolVO> selectCurrentRiskUserPatrolDetailList(CurrentRiskUserPatrol currentRiskUserPatrol)
{
return currentRiskUserPatrolMapper.selectCurrentRiskUserPatrolDetailList(currentRiskUserPatrol);
}
/**
* 查询巡查执行管理列表
*
......
......@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectCurrentRiskPostListList3" resultMap="CurrentRiskPostListResult">
select * from current_risk_post_list where status = '1' GROUP BY user_id,patrol_type
select * from current_risk_post_list where status != 1 GROUP BY user_id,patrol_type
</select>
......
......@@ -199,7 +199,7 @@
c.remark,
c.factor_items,
a.id patrolDetailId,
a.patrol_id patrolId,
a.patrol_id patrol_id,
a.STATUS patrolStatus,
d.address,
d.id buildId
......@@ -210,6 +210,6 @@
INNER JOIN ledger_room r on c.room_id=r.id
INNER JOIN ledger_floor f on r.floor_id=f.id
INNER JOIN ledger_building d on f.building_id=d.id
where b.project_id=#{projectId} and b.user_id=#{userId}
where b.project_id=#{projectId} and b.user_id=#{userId} and a.patrol_id=#{patrolId}
</select>
</mapper>
\ No newline at end of file
......@@ -69,12 +69,10 @@
a.update_time,
a.remark,
b.risk_post_name,
c.nick_name,
d.status except_status
c.nick_name
FROM
current_risk_user_patrol a
LEFT JOIN ledger_project p on a.project_id=p.id
LEFT JOIN current_risk_user_patrol_detail d on a.id=d.patrol_id
LEFT JOIN current_risk_post b on a.risk_post_id = b.id
LEFT JOIN sys_user c on a.user_id = c.user_id
<where>
......@@ -89,7 +87,7 @@
</where>
</select>
<select id="selectCurrentRiskUserPatrolDetail" parameterType="Long" resultType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolVO">
<select id="selectCurrentRiskUserPatrolDetail" parameterType="Long" resultType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolVO">
SELECT
a.id,
p.NAME project_name,
......@@ -113,11 +111,51 @@
FROM
current_risk_user_patrol a
LEFT JOIN ledger_project p ON a.project_id = p.id
LEFT JOIN current_risk_user_patrol_detail d ON a.id = d.patrol_id
inner JOIN current_risk_user_patrol_detail d ON a.id = d.patrol_id
LEFT JOIN risk_plan_existing_list e ON d.current_risk_id = e.id
LEFT JOIN current_risk_post b ON a.risk_post_id = b.id
LEFT JOIN sys_user c ON a.user_id = c.user_id
where a.id = #{id}
where d.id = #{id}
</select>
<select id="selectCurrentRiskUserPatrolDetailList" resultType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrolVO">
SELECT
d.id,
p.NAME project_name,
e.type,
e.LEVEL,
e.factor,
e.measures_project,
e.measures_administration,
e.measures_emergency,
a.user_id,
a.project_id,
a.risk_post_id,
a.patrol_type,
a.STATUS,
a.start_time,
a.end_time,
a.validity_time,
b.risk_post_name,
c.nick_name,
d.STATUS except_status
FROM
current_risk_user_patrol a
LEFT JOIN ledger_project p ON a.project_id = p.id
inner JOIN current_risk_user_patrol_detail d ON a.id = d.patrol_id
LEFT JOIN risk_plan_existing_list e ON d.current_risk_id = e.id
LEFT JOIN current_risk_post b ON a.risk_post_id = b.id
LEFT JOIN sys_user c ON a.user_id = c.user_id
<where>
<if test="userId != null ">and a.user_id = #{userId}</if>
<if test="projectId != null ">and a.project_id = #{projectId}</if>
<if test="riskPostId != null ">and a.risk_post_id = #{riskPostId}</if>
<if test="patrolType != null ">and a.patrol_type = #{patrolType}</if>
<if test="status != null and status != ''">and a.status = #{status}</if>
<if test="startTime != null ">and a.start_time = #{startTime}</if>
<if test="endTime != null ">and a.end_time = #{endTime}</if>
<if test="sortNum != null ">and a.sort_num = #{sortNum}</if>
</where>
</select>
<select id="getPatrolProjectList" resultType="com.censoft.censoftrongtong.domain.LedgerProject">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment