Commit 8423133e authored by yf's avatar yf

修改巡查管理相关接口

parent 944d8c92
...@@ -37,9 +37,8 @@ import com.ruoyi.common.core.page.TableDataInfo; ...@@ -37,9 +37,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@AllArgsConstructor @AllArgsConstructor
@RequestMapping(value = {"/risk/currentRiskHoliday","/app-api/risk/currentRiskHoliday"}) @RequestMapping(value = {"/risk/currentRiskHoliday", "/app-api/risk/currentRiskHoliday"})
public class CurrentRiskUserHolidayController extends BaseController public class CurrentRiskUserHolidayController extends BaseController {
{
private ICurrentRiskUserHolidayService currentRiskUserHolidayService; private ICurrentRiskUserHolidayService currentRiskUserHolidayService;
private ISysUserService sysUserService; private ISysUserService sysUserService;
...@@ -47,32 +46,32 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -47,32 +46,32 @@ public class CurrentRiskUserHolidayController extends BaseController
* 查询现状风险巡查用户请假列表 * 查询现状风险巡查用户请假列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(CurrentRiskUserHoliday currentRiskUserHoliday) public TableDataInfo list(CurrentRiskUserHoliday currentRiskUserHoliday) {
{
startPage(); startPage();
QueryWrapper<CurrentRiskUserHoliday> queryWrapper = new QueryWrapper<>(); QueryWrapper<CurrentRiskUserHoliday> queryWrapper = new QueryWrapper<>();
if("0".equals(currentRiskUserHoliday.getType())){ if ("0".equals(currentRiskUserHoliday.getType())) {
//申请人 //申请人
queryWrapper.eq("apply_user_id",getUserId()); queryWrapper.eq("apply_user_id", getUserId());
}else{ } else {
//审批人 //审批人
queryWrapper.in("apply_user_id",currentRiskUserHolidayService.memberUserIds(getUserId())); queryWrapper.in("apply_user_id", currentRiskUserHolidayService.memberUserIds(getUserId()));
} }
if(!StringUtils.isEmpty(currentRiskUserHoliday.getStatus())){ if (!StringUtils.isEmpty(currentRiskUserHoliday.getStatus())) {
queryWrapper.eq("status",currentRiskUserHoliday.getStatus()); queryWrapper.eq("status", currentRiskUserHoliday.getStatus());
} }
queryWrapper.orderByAsc(" status"); queryWrapper.orderByAsc(" status");
queryWrapper.orderByDesc("holiday_time"); queryWrapper.orderByDesc("holiday_time");
List<CurrentRiskUserHoliday> list = currentRiskUserHolidayService.list(queryWrapper); List<CurrentRiskUserHoliday> list = currentRiskUserHolidayService.list(queryWrapper);
if(!CollectionUtils.isEmpty(list)){ if (!CollectionUtils.isEmpty(list)) {
list.forEach(holiday ->{ list.forEach(holiday -> {
if("0".equals(currentRiskUserHoliday.getType())){ if ("0".equals(currentRiskUserHoliday.getType())) {
holiday.setApplyUserName(getUsername()); SysUser sysUser = sysUserService.selectUserById(getUserId());
}else{ holiday.setApplyUserName(sysUser.getNickName());
} else {
SysUser sysUser = sysUserService.selectUserById(holiday.getApplyUserId()); SysUser sysUser = sysUserService.selectUserById(holiday.getApplyUserId());
holiday.setApplyUserName(sysUser.getNickName()); holiday.setApplyUserName(sysUser.getNickName());
} }
if(holiday.getApproveUserId() != null){ if (holiday.getApproveUserId() != null) {
SysUser sysUser = sysUserService.selectUserById(holiday.getApproveUserId()); SysUser sysUser = sysUserService.selectUserById(holiday.getApproveUserId());
holiday.setApproveUserName(sysUser.getNickName()); holiday.setApproveUserName(sysUser.getNickName());
} }
...@@ -87,8 +86,7 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -87,8 +86,7 @@ public class CurrentRiskUserHolidayController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:export')") @PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:export')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.EXPORT) @Log(title = "现状风险巡查用户请假", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskUserHoliday currentRiskUserHoliday) public void export(HttpServletResponse response, CurrentRiskUserHoliday currentRiskUserHoliday) {
{
List<CurrentRiskUserHoliday> list = currentRiskUserHolidayService.selectCurrentRiskUserHolidayList(currentRiskUserHoliday); List<CurrentRiskUserHoliday> list = currentRiskUserHolidayService.selectCurrentRiskUserHolidayList(currentRiskUserHoliday);
ExcelUtil<CurrentRiskUserHoliday> util = new ExcelUtil<CurrentRiskUserHoliday>(CurrentRiskUserHoliday.class); ExcelUtil<CurrentRiskUserHoliday> util = new ExcelUtil<CurrentRiskUserHoliday>(CurrentRiskUserHoliday.class);
util.exportExcel(response, list, "现状风险巡查用户请假数据"); util.exportExcel(response, list, "现状风险巡查用户请假数据");
...@@ -99,8 +97,7 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -99,8 +97,7 @@ public class CurrentRiskUserHolidayController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:query')") @PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(currentRiskUserHolidayService.selectCurrentRiskUserHolidayById(id)); return success(currentRiskUserHolidayService.selectCurrentRiskUserHolidayById(id));
} }
...@@ -110,15 +107,14 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -110,15 +107,14 @@ public class CurrentRiskUserHolidayController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:add')") @PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:add')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.INSERT) @Log(title = "现状风险巡查用户请假", businessType = BusinessType.INSERT)
@PostMapping("/save") @PostMapping("/save")
public AjaxResult add(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) public AjaxResult add(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) {
{ if (null == currentRiskUserHoliday.getId()) {
if(null == currentRiskUserHoliday.getId()){
currentRiskUserHoliday.setApplyUserId(getUserId()); currentRiskUserHoliday.setApplyUserId(getUserId());
currentRiskUserHoliday.setApplyTime(new Date()); currentRiskUserHoliday.setApplyTime(new Date());
currentRiskUserHoliday.setStatus("0"); currentRiskUserHoliday.setStatus("0");
//TODO 查询上级项目经理 改为已知晓,不做逻辑处理 //TODO 查询上级项目经理 改为已知晓,不做逻辑处理
currentRiskUserHolidayService.insertCurrentRiskUserHoliday(currentRiskUserHoliday); currentRiskUserHolidayService.insertCurrentRiskUserHoliday(currentRiskUserHoliday);
}else{ } else {
currentRiskUserHoliday.setApproveTime(new Date()); currentRiskUserHoliday.setApproveTime(new Date());
currentRiskUserHoliday.setApproveUserId(getUserId()); currentRiskUserHoliday.setApproveUserId(getUserId());
currentRiskUserHolidayService.updateCurrentRiskUserHoliday(currentRiskUserHoliday); currentRiskUserHolidayService.updateCurrentRiskUserHoliday(currentRiskUserHoliday);
...@@ -132,8 +128,7 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -132,8 +128,7 @@ public class CurrentRiskUserHolidayController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:edit')") @PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:edit')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.UPDATE) @Log(title = "现状风险巡查用户请假", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) public AjaxResult edit(@RequestBody CurrentRiskUserHoliday currentRiskUserHoliday) {
{
return toAjax(currentRiskUserHolidayService.updateCurrentRiskUserHoliday(currentRiskUserHoliday)); return toAjax(currentRiskUserHolidayService.updateCurrentRiskUserHoliday(currentRiskUserHoliday));
} }
...@@ -143,8 +138,7 @@ public class CurrentRiskUserHolidayController extends BaseController ...@@ -143,8 +138,7 @@ public class CurrentRiskUserHolidayController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:remove')") @PreAuthorize("@ss.hasPermi('risk:currentRiskHoliday:remove')")
@Log(title = "现状风险巡查用户请假", businessType = BusinessType.DELETE) @Log(title = "现状风险巡查用户请假", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(currentRiskUserHolidayService.deleteCurrentRiskUserHolidayByIds(ids)); return toAjax(currentRiskUserHolidayService.deleteCurrentRiskUserHolidayByIds(ids));
} }
} }
...@@ -2,6 +2,9 @@ package com.censoft.censoftrongtong.controller; ...@@ -2,6 +2,9 @@ package com.censoft.censoftrongtong.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.censoft.censoftrongtong.domain.LedgerProject;
import com.censoft.censoftrongtong.service.ILedgerProjectService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -28,18 +31,23 @@ import com.ruoyi.common.core.page.TableDataInfo; ...@@ -28,18 +31,23 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2023-12-05 * @date 2023-12-05
*/ */
@RestController @RestController
@RequestMapping(value={"/risk/riskUserPatrol","/app-api/risk/riskUserPatrol"}) @RequestMapping(value = {"/risk/riskUserPatrol", "/app-api/risk/riskUserPatrol"})
public class CurrentRiskUserPatrolController extends BaseController public class CurrentRiskUserPatrolController extends BaseController {
{
@Autowired @Autowired
private ICurrentRiskUserPatrolService currentRiskUserPatrolService; private ICurrentRiskUserPatrolService currentRiskUserPatrolService;
@GetMapping("/getPatrolProjectList")
private List<LedgerProject> getPatrolProjectList() {
List<LedgerProject> list = currentRiskUserPatrolService.getPatrolProjectList(getUserId());
return list;
}
/** /**
* 查询巡查执行管理列表 * 查询巡查执行管理列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(CurrentRiskUserPatrol currentRiskUserPatrol) public TableDataInfo list(CurrentRiskUserPatrol currentRiskUserPatrol) {
{
startPage(); startPage();
List<CurrentRiskUserPatrol> list = currentRiskUserPatrolService.selectCurrentRiskUserPatrolList(currentRiskUserPatrol); List<CurrentRiskUserPatrol> list = currentRiskUserPatrolService.selectCurrentRiskUserPatrolList(currentRiskUserPatrol);
return getDataTable(list); return getDataTable(list);
...@@ -51,8 +59,7 @@ public class CurrentRiskUserPatrolController extends BaseController ...@@ -51,8 +59,7 @@ public class CurrentRiskUserPatrolController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:export')") @PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:export')")
@Log(title = "巡查执行管理", businessType = BusinessType.EXPORT) @Log(title = "巡查执行管理", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, CurrentRiskUserPatrol currentRiskUserPatrol) public void export(HttpServletResponse response, CurrentRiskUserPatrol currentRiskUserPatrol) {
{
List<CurrentRiskUserPatrol> list = currentRiskUserPatrolService.selectCurrentRiskUserPatrolList(currentRiskUserPatrol); List<CurrentRiskUserPatrol> list = currentRiskUserPatrolService.selectCurrentRiskUserPatrolList(currentRiskUserPatrol);
ExcelUtil<CurrentRiskUserPatrol> util = new ExcelUtil<CurrentRiskUserPatrol>(CurrentRiskUserPatrol.class); ExcelUtil<CurrentRiskUserPatrol> util = new ExcelUtil<CurrentRiskUserPatrol>(CurrentRiskUserPatrol.class);
util.exportExcel(response, list, "巡查执行管理数据"); util.exportExcel(response, list, "巡查执行管理数据");
...@@ -63,8 +70,7 @@ public class CurrentRiskUserPatrolController extends BaseController ...@@ -63,8 +70,7 @@ public class CurrentRiskUserPatrolController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:query')") @PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(currentRiskUserPatrolService.selectCurrentRiskUserPatrolById(id)); return success(currentRiskUserPatrolService.selectCurrentRiskUserPatrolById(id));
} }
...@@ -74,8 +80,7 @@ public class CurrentRiskUserPatrolController extends BaseController ...@@ -74,8 +80,7 @@ public class CurrentRiskUserPatrolController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:add')") @PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:add')")
@Log(title = "巡查执行管理", businessType = BusinessType.INSERT) @Log(title = "巡查执行管理", businessType = BusinessType.INSERT)
@PostMapping("save") @PostMapping("save")
public AjaxResult add(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) public AjaxResult add(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) {
{
return toAjax(currentRiskUserPatrolService.insertCurrentRiskUserPatrol(currentRiskUserPatrol)); return toAjax(currentRiskUserPatrolService.insertCurrentRiskUserPatrol(currentRiskUserPatrol));
} }
...@@ -85,8 +90,7 @@ public class CurrentRiskUserPatrolController extends BaseController ...@@ -85,8 +90,7 @@ public class CurrentRiskUserPatrolController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:edit')") @PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:edit')")
@Log(title = "巡查执行管理", businessType = BusinessType.UPDATE) @Log(title = "巡查执行管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) public AjaxResult edit(@RequestBody CurrentRiskUserPatrol currentRiskUserPatrol) {
{
return toAjax(currentRiskUserPatrolService.updateCurrentRiskUserPatrol(currentRiskUserPatrol)); return toAjax(currentRiskUserPatrolService.updateCurrentRiskUserPatrol(currentRiskUserPatrol));
} }
...@@ -96,8 +100,7 @@ public class CurrentRiskUserPatrolController extends BaseController ...@@ -96,8 +100,7 @@ public class CurrentRiskUserPatrolController extends BaseController
@PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:remove')") @PreAuthorize("@ss.hasPermi('risk:riskUserPatrol:remove')")
@Log(title = "巡查执行管理", businessType = BusinessType.DELETE) @Log(title = "巡查执行管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(currentRiskUserPatrolService.deleteCurrentRiskUserPatrolByIds(ids)); return toAjax(currentRiskUserPatrolService.deleteCurrentRiskUserPatrolByIds(ids));
} }
} }
...@@ -64,11 +64,11 @@ public class CurrentRiskUserPatrolDetailController extends BaseController ...@@ -64,11 +64,11 @@ public class CurrentRiskUserPatrolDetailController extends BaseController
* 查询现状风险用户巡查明细列表 * 查询现状风险用户巡查明细列表
*/ */
@GetMapping("/detailList") @GetMapping("/detailList")
public TableDataInfo detailList(CurrentRiskUserPatrolDetail currentRiskUserPatrolDetail) public TableDataInfo detailList(RiskExistingListPatrolVO query)
{ {
startPage(); startPage();
String patrolId = String.valueOf(currentRiskUserPatrolDetail.getPatrolId()); query.setUserId(getUserId());
List<RiskExistingListPatrolVO> list = currentRiskUserPatrolDetailService.riskExistingLists(patrolId); List<RiskExistingListPatrolVO> list = currentRiskUserPatrolDetailService.riskExistingLists(query);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -10,4 +10,6 @@ public class RiskExistingListPatrolVO extends RiskPlanExistingList{ ...@@ -10,4 +10,6 @@ public class RiskExistingListPatrolVO extends RiskPlanExistingList{
private String patrolId; private String patrolId;
private String patrolStatus; private String patrolStatus;
private Long projectId;
} }
...@@ -62,5 +62,5 @@ public interface CurrentRiskUserPatrolDetailMapper extends MPJBaseMapper<Curren ...@@ -62,5 +62,5 @@ public interface CurrentRiskUserPatrolDetailMapper extends MPJBaseMapper<Curren
*/ */
public int deleteCurrentRiskUserPatrolDetailByIds(Long[] ids); public int deleteCurrentRiskUserPatrolDetailByIds(Long[] ids);
List<RiskExistingListPatrolVO> riskExistingLists(@Param("patrolId") String patrolId); List<RiskExistingListPatrolVO> riskExistingLists(RiskExistingListPatrolVO model);
} }
...@@ -2,6 +2,7 @@ package com.censoft.censoftrongtong.mapper; ...@@ -2,6 +2,7 @@ package com.censoft.censoftrongtong.mapper;
import java.util.List; import java.util.List;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol; import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol;
import com.censoft.censoftrongtong.domain.LedgerProject;
import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.base.MPJBaseMapper;
/** /**
...@@ -20,6 +21,15 @@ public interface CurrentRiskUserPatrolMapper extends MPJBaseMapper<CurrentRiskU ...@@ -20,6 +21,15 @@ public interface CurrentRiskUserPatrolMapper extends MPJBaseMapper<CurrentRiskU
*/ */
public CurrentRiskUserPatrol selectCurrentRiskUserPatrolById(Long id); public CurrentRiskUserPatrol selectCurrentRiskUserPatrolById(Long id);
/**
* 根据用户id获取巡检项目
* @param userId
* @return
*/
public List<LedgerProject> getPatrolProjectList(Long userId);
/** /**
* 查询巡查执行管理列表 * 查询巡查执行管理列表
* *
......
...@@ -60,5 +60,5 @@ public interface ICurrentRiskUserPatrolDetailService extends MPJBaseService<Cur ...@@ -60,5 +60,5 @@ public interface ICurrentRiskUserPatrolDetailService extends MPJBaseService<Cur
*/ */
public int deleteCurrentRiskUserPatrolDetailById(Long id); public int deleteCurrentRiskUserPatrolDetailById(Long id);
List<RiskExistingListPatrolVO> riskExistingLists(String patrolId); List<RiskExistingListPatrolVO> riskExistingLists(RiskExistingListPatrolVO model);
} }
...@@ -2,6 +2,7 @@ package com.censoft.censoftrongtong.service; ...@@ -2,6 +2,7 @@ package com.censoft.censoftrongtong.service;
import java.util.List; import java.util.List;
import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol; import com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol;
import com.censoft.censoftrongtong.domain.LedgerProject;
import com.github.yulichang.base.MPJBaseService; import com.github.yulichang.base.MPJBaseService;
/** /**
* 巡查执行管理Service接口 * 巡查执行管理Service接口
...@@ -27,6 +28,12 @@ public interface ICurrentRiskUserPatrolService extends MPJBaseService<CurrentRi ...@@ -27,6 +28,12 @@ public interface ICurrentRiskUserPatrolService extends MPJBaseService<CurrentRi
*/ */
public List<CurrentRiskUserPatrol> selectCurrentRiskUserPatrolList(CurrentRiskUserPatrol currentRiskUserPatrol); public List<CurrentRiskUserPatrol> selectCurrentRiskUserPatrolList(CurrentRiskUserPatrol currentRiskUserPatrol);
/**
* 根据用户id查询巡检项目列表
* @param userId
* @return
*/
public List<LedgerProject> getPatrolProjectList(Long userId);
/** /**
* 新增巡查执行管理 * 新增巡查执行管理
* *
......
...@@ -97,7 +97,7 @@ public class CurrentRiskUserPatrolDetailServiceImpl extends MPJBaseServiceImpl<C ...@@ -97,7 +97,7 @@ public class CurrentRiskUserPatrolDetailServiceImpl extends MPJBaseServiceImpl<C
} }
@Override @Override
public List<RiskExistingListPatrolVO> riskExistingLists(String patrolId) { public List<RiskExistingListPatrolVO> riskExistingLists(RiskExistingListPatrolVO model) {
return currentRiskUserPatrolDetailMapper.riskExistingLists(patrolId); return currentRiskUserPatrolDetailMapper.riskExistingLists(model);
} }
} }
package com.censoft.censoftrongtong.service.impl; package com.censoft.censoftrongtong.service.impl;
import java.util.List; import java.util.List;
import com.censoft.censoftrongtong.domain.LedgerProject;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -44,6 +46,18 @@ public class CurrentRiskUserPatrolServiceImpl extends MPJBaseServiceImpl<Current ...@@ -44,6 +46,18 @@ public class CurrentRiskUserPatrolServiceImpl extends MPJBaseServiceImpl<Current
return currentRiskUserPatrolMapper.selectCurrentRiskUserPatrolList(currentRiskUserPatrol); return currentRiskUserPatrolMapper.selectCurrentRiskUserPatrolList(currentRiskUserPatrol);
} }
/**
* 根据用户id获取巡检项目
* @param userId
* @return
*/
@Override
public List<LedgerProject> getPatrolProjectList(Long userId)
{
return currentRiskUserPatrolMapper.getPatrolProjectList(userId);
}
/** /**
* 新增巡查执行管理 * 新增巡查执行管理
* *
......
...@@ -167,17 +167,44 @@ ...@@ -167,17 +167,44 @@
<result property="patrolStatus" column="patrolStatus"/> <result property="patrolStatus" column="patrolStatus"/>
</resultMap> </resultMap>
<select id="riskExistingLists" resultMap="RiskPlanExistingListResult" parameterType="java.lang.String"> <select id="riskExistingLists" resultMap="RiskPlanExistingListResult">
select b.id,b.user_id,b.inherent_id, SELECT
b.plan_id,b.room_id,b.name,b.factor,b.type, b.project_id,
b.level,b.presence_location,b.picture_file_ids,b.measures_project,b.measures_project_file_ids, b.user_id,
b.measures_administration,b.measures_dept_name,b.measures_user_name,b.measures_user_phone, c.id,
b.measures_administration_file_ids,b.measures_emergency, c.inherent_id,
b.measures_emergency_file_ids,b.reference_basis,b.del_flag,b.create_by, c.plan_id,
b.create_time,b.update_by,b.update_time,b.remark,b.factor_items, c.room_id,
a.id patrolDetailId,a.patrol_id patrolId,a.STATUS patrolStatus c.NAME,
from current_risk_user_patrol_detail a c.factor,
INNER JOIN risk_plan_existing_list b ON a.current_risk_id = b.id c.type,
where a.patrol_id = #{patrolId} c.LEVEL,
c.presence_location,
c.picture_file_ids,
c.measures_project,
c.measures_project_file_ids,
c.measures_administration,
c.measures_dept_name,
c.measures_user_name,
c.measures_user_phone,
c.measures_administration_file_ids,
c.measures_emergency,
c.measures_emergency_file_ids,
c.reference_basis,
c.del_flag,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark,
c.factor_items,
a.id patrolDetailId,
a.patrol_id patrolId,
a.STATUS patrolStatus
FROM
current_risk_user_patrol_detail a
INNER JOIN current_risk_user_patrol b ON a.patrol_id = b.id
INNER JOIN risk_plan_existing_list c ON a.current_risk_id = c.id
where b.project_id=#{projectId} and b.user_id=#{userId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.censoft.censoftrongtong.mapper.CurrentRiskUserPatrolMapper"> <mapper namespace="com.censoft.censoftrongtong.mapper.CurrentRiskUserPatrolMapper">
<resultMap type="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol" id="CurrentRiskUserPatrolResult"> <resultMap type="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol" id="CurrentRiskUserPatrolResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="userId" column="user_id" /> <result property="userId" column="user_id"/>
<result property="projectId" column="project_id" /> <result property="projectId" column="project_id"/>
<result property="riskPostId" column="risk_post_id" /> <result property="riskPostId" column="risk_post_id"/>
<result property="patrolType" column="patrol_type" /> <result property="patrolType" column="patrol_type"/>
<result property="status" column="status" /> <result property="status" column="status"/>
<result property="startTime" column="start_time" /> <result property="startTime" column="start_time"/>
<result property="endTime" column="end_time" /> <result property="endTime" column="end_time"/>
<result property="sortNum" column="sort_num" /> <result property="sortNum" column="sort_num"/>
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="riskPostName" column="risk_post_name" /> <result property="riskPostName" column="risk_post_name"/>
<result property="nickName" column="nick_name" /> <result property="nickName" column="nick_name"/>
<result property="validityTime" column="validity_time" /> <result property="validityTime" column="validity_time"/>
</resultMap> </resultMap>
<sql id="selectCurrentRiskUserPatrolVo"> <sql id="selectCurrentRiskUserPatrolVo">
select a.id, user_id, project_id, risk_post_id, patrol_type, status, start_time, end_time, sort_num, a.validity_time, select a.id,
del_flag, create_by, create_time, update_by, update_time, remark from current_risk_user_patrol a user_id,
project_id,
risk_post_id,
patrol_type,
status,
start_time,
end_time,
sort_num,
a.validity_time,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from current_risk_user_patrol a
</sql> </sql>
<select id="selectCurrentRiskUserPatrolList" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol" resultMap="CurrentRiskUserPatrolResult"> <select id="selectCurrentRiskUserPatrolList"
parameterType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol"
resultMap="CurrentRiskUserPatrolResult">
SELECT SELECT
a.id, a.id,
a.user_id, a.user_id,
...@@ -55,14 +72,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,14 +72,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN current_risk_post b on a.risk_post_id = b.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 LEFT JOIN sys_user c on a.user_id = c.user_id
<where> <where>
<if test="userId != null "> and a.user_id = #{userId}</if> <if test="userId != null ">and a.user_id = #{userId}</if>
<if test="projectId != null "> and a.project_id = #{projectId}</if> <if test="projectId != null ">and a.project_id = #{projectId}</if>
<if test="riskPostId != null "> and a.risk_post_id = #{riskPostId}</if> <if test="riskPostId != null ">and a.risk_post_id = #{riskPostId}</if>
<if test="patrolType != null "> and a.patrol_type = #{patrolType}</if> <if test="patrolType != null ">and a.patrol_type = #{patrolType}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if> <if test="status != null and status != ''">and a.status = #{status}</if>
<if test="startTime != null "> and a.start_time = #{startTime}</if> <if test="startTime != null ">and a.start_time = #{startTime}</if>
<if test="endTime != null "> and a.end_time = #{endTime}</if> <if test="endTime != null ">and a.end_time = #{endTime}</if>
<if test="sortNum != null "> and a.sort_num = #{sortNum}</if> <if test="sortNum != null ">and a.sort_num = #{sortNum}</if>
</where>
</select>
<select id="getPatrolProjectList" resultType="com.censoft.censoftrongtong.domain.LedgerProject">
select b.id,b.name.b.type,b.business,b.address from current_risk_user_patrol a LEFT JOIN ledger_project b on
a.project_id=b.id
<where>
and del_flage=0
<if test="userId != null ">and a.user_id = #{userId}</if>
</where> </where>
</select> </select>
...@@ -71,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -71,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertCurrentRiskUserPatrol" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol" useGeneratedKeys="true" keyProperty="id"> <insert id="insertCurrentRiskUserPatrol" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskUserPatrol"
useGeneratedKeys="true" keyProperty="id">
insert into current_risk_user_patrol insert into current_risk_user_patrol
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
...@@ -131,7 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -131,7 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteCurrentRiskUserPatrolById" parameterType="Long"> <delete id="deleteCurrentRiskUserPatrolById" parameterType="Long">
delete from current_risk_user_patrol where id = #{id} delete
from current_risk_user_patrol
where id = #{id}
</delete> </delete>
<delete id="deleteCurrentRiskUserPatrolByIds" parameterType="String"> <delete id="deleteCurrentRiskUserPatrolByIds" parameterType="String">
......
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