Browse Source

新增值班人员详情

develop
wangsixiang 1 year ago
parent
commit
8d5136ad88
  1. 10
      zc-business/src/main/java/com/zc/business/controller/DcShiftsController.java
  2. 2
      zc-business/src/main/java/com/zc/business/controller/DcWarningController.java
  3. 2
      zc-business/src/main/java/com/zc/business/mapper/DcShiftsMapper.java
  4. 8
      zc-business/src/main/java/com/zc/business/service/IDcShiftsService.java
  5. 8
      zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java
  6. 21
      zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml

10
zc-business/src/main/java/com/zc/business/controller/DcShiftsController.java

@ -88,7 +88,15 @@ public class DcShiftsController extends BaseController
{ {
return AjaxResult.success(dcShiftsService.selectDcShiftsById(id)); return AjaxResult.success(dcShiftsService.selectDcShiftsById(id));
} }
//获取值班列表单个值班包含的人员信息
@PostMapping("/byStation")
public AjaxResult selectDcShiftsByStationId(@RequestBody DcShifts dcShifts)
{
if (dcShifts==null||dcShifts.getStation()==null||dcShifts.getDate()==null){
return AjaxResult.error("参数错误");
}
return AjaxResult.success(dcShiftsService.selectDcShiftsByStationId(dcShifts));
}
/** /**
* 新增值班 * 新增值班
*/ */

2
zc-business/src/main/java/com/zc/business/controller/DcWarningController.java

@ -107,7 +107,7 @@ public class DcWarningController extends BaseController
{ {
return dcWarningService.updateWarningConvert(dcWarning); return dcWarningService.updateWarningConvert(dcWarning);
} }
//感知事件转交通事件 //感知事件删除
@PostMapping("/delete") @PostMapping("/delete")
public AjaxResult deleteDcWarningByStringId(@RequestBody DcWarning dcWarning) public AjaxResult deleteDcWarningByStringId(@RequestBody DcWarning dcWarning)
{ {

2
zc-business/src/main/java/com/zc/business/mapper/DcShiftsMapper.java

@ -79,7 +79,7 @@ public interface DcShiftsMapper
* @param id 值班主键 * @param id 值班主键
* @return 值班 * @return 值班
*/ */
public DcShifts selectDcShiftsByEmployeesId(Long id); public List<DcShifts> selectDcShiftsByStationId(DcShifts dcShifts);
//查询操作记录表 //查询操作记录表
public List<DcShiftsRecord> selectDcShiftsRecord(DcShifts dcShifts); public List<DcShiftsRecord> selectDcShiftsRecord(DcShifts dcShifts);
//根据驻点和时间查询人员 //根据驻点和时间查询人员

8
zc-business/src/main/java/com/zc/business/service/IDcShiftsService.java

@ -23,7 +23,13 @@ public interface IDcShiftsService
* @return 值班 * @return 值班
*/ */
public DcShifts selectDcShiftsById(Long id); public DcShifts selectDcShiftsById(Long id);
/**
* 查询值班
*
* @param dcShifts 值班主键
* @return 值班
*/
public List<DcShifts> selectDcShiftsByStationId(DcShifts dcShifts);
/** /**
* 查询值班列表 * 查询值班列表
* *

8
zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java

@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 值班Service业务层处理 * 值班Service业务层处理
@ -58,6 +59,11 @@ public class DcShiftsServiceImpl implements IDcShiftsService
return dcShiftsMapper.selectDcShiftsById(id); return dcShiftsMapper.selectDcShiftsById(id);
} }
@Override
public List<DcShifts> selectDcShiftsByStationId(DcShifts dcShifts) {
return dcShiftsMapper.selectDcShiftsByStationId(dcShifts);
}
/** /**
* 查询值班列表 * 查询值班列表
* *
@ -67,6 +73,7 @@ public class DcShiftsServiceImpl implements IDcShiftsService
@Override @Override
public List<DcShifts> selectDcShiftsList(DcShifts dcShifts) public List<DcShifts> selectDcShiftsList(DcShifts dcShifts)
{ {
List<DcShifts> list = dcShiftsMapper.selectDcShiftsList(dcShifts); List<DcShifts> list = dcShiftsMapper.selectDcShiftsList(dcShifts);
for (DcShifts shifts:list ){ for (DcShifts shifts:list ){
String name=""; String name="";
@ -81,6 +88,7 @@ public class DcShiftsServiceImpl implements IDcShiftsService
return list; return list;
} }
@Override @Override
public List<DcShifts> selectDcShiftsListExcel(DcShifts dcShifts) { public List<DcShifts> selectDcShiftsListExcel(DcShifts dcShifts) {
return dcShiftsMapper.selectDcShiftsList(dcShifts); return dcShiftsMapper.selectDcShiftsList(dcShifts);

21
zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectDcShiftsList" parameterType="DcShifts" resultMap="DcShiftsResult"> <select id="selectDcShiftsList" parameterType="DcShifts" resultMap="DcShiftsResult">
select shifts.id, select DISTINCT shifts.id,
shifts.station,organization.organization_name, shifts.station,organization.organization_name,
shifts.date, shifts.start_time, shifts.end_time, shifts.date, shifts.start_time, shifts.end_time,
shifts.remark, shifts.create_time, shifts.update_time from dc_shifts as shifts shifts.remark, shifts.create_time, shifts.update_time from dc_shifts as shifts
@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_post as post on employees.post_id=post.post_id left join sys_post as post on employees.post_id=post.post_id
left join dc_organization as organization on organization.id=shifts.station left join dc_organization as organization on organization.id=shifts.station
<where> <where>
<if test="station != null "> and shifts.station = #{station}</if>
<if test="employeesId != null "> and shifts.employees_id = #{employeesId}</if> <if test="employeesId != null "> and shifts.employees_id = #{employeesId}</if>
<if test="date != null "> and shifts.date = #{date}</if> <if test="date != null "> and shifts.date = #{date}</if>
<if test="name != null and name != ''"> and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%')</if>
@ -50,9 +51,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDcShiftsVo"/> <include refid="selectDcShiftsVo"/>
where shifts.id = #{id} where shifts.id = #{id}
</select> </select>
<select id="selectDcShiftsByEmployeesId" parameterType="Long" resultMap="DcShiftsResult"> <select id="selectDcShiftsByStationId" resultMap="DcShiftsResult">
<include refid="selectDcShiftsVo"/> select DISTINCT shifts.scheduling,shifts.employees_id,shifts.station,shifts.id,employees.contact_number,
where shifts.employees_id = #{id} organization.organization_name ,employees.name from dc_shifts as shifts
left join dc_employees as employees on shifts.employees_id=employees.id
left join dc_organization as organization on organization.id=shifts.station
where shifts.station = #{station}
and shifts.date =#{date}
</select> </select>
<select id="contactNumber" resultType="java.util.HashMap"> <select id="contactNumber" resultType="java.util.HashMap">
select id from dc_employees where contact_number=#{contactNumber} select id from dc_employees where contact_number=#{contactNumber}
@ -90,10 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectStationDate" resultType="com.zc.business.domain.DcShiftsList"> <select id="selectStationDate" resultType="com.zc.business.domain.DcShiftsList">
select shifts.scheduling,shifts.employees_id,shifts.station,shifts.id,employees.contact_number, select DISTINCT shifts.scheduling,shifts.employees_id,shifts.station,shifts.id,employees.contact_number,
organization.organization_name ,employees.name from dc_shifts as shifts organization.organization_name ,employees.name from dc_shifts as shifts
left join dc_employees as employees on shifts.employees_id=employees.id left join dc_employees as employees on shifts.employees_id=employees.id
left join dc_organization as organization on organization.id=shifts.station left join dc_organization as organization on organization.id=shifts.station
where shifts.date=#{date} and station=#{station} where shifts.date=#{date} and station=#{station}
<if test="name != null and name != ''"> and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%')</if>
</select> </select>

Loading…
Cancel
Save