Commit 023db654 authored by 高建强's avatar 高建强

item:新增获取指定日期值班人员统计

parent b7d61f76
......@@ -150,4 +150,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
String getFirstAidCompanyId ();
List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType);
}
......@@ -119,6 +119,36 @@
AND i.field_value != ''
GROUP BY i.field_value
</select>
<select id="dayDutyStatistics" resultType="java.util.Map">
SELECT
i.field_value AS postTypeName,
count( 1 ) AS total,
d.`code`,
MAX( CASE d.`code` WHEN '1601' THEN 'firePerson' WHEN '1602' THEN 'opsPerson' WHEN '1601' THEN 'securityPerson' ELSE 'otherPerson' END ) AS postType
FROM
cb_duty_person_shift s,
cb_dynamic_form_instance i
LEFT JOIN cb_data_dictionary d ON i.field_value = d.`name`
WHERE
s.instance_id = i.instance_id
<if test="fieldCode != null and fieldCode != ''">
AND i.field_code = #{fieldCode}
</if>
<if test="date != null and date != ''">
AND s.duty_date = #{date}
</if>
AND s.shift_id IS NOT NULL
<if test="groupCode != null and groupCode != ''">
AND i.group_code = #{groupCode}
</if>
AND i.field_value IS NOT NULL
AND i.field_value != ''
<if test="dictType != null and dictType != ''">
AND d.type = #{dictType}
</if>
GROUP BY
i.field_value
</select>
<select id="genRangeDate" resultType="map">
SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
......
......@@ -149,6 +149,18 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate, fieldCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/day-duty-statistics")
@ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员统计", notes = "获取指定日期值班人员统计")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "值班日期", required = true) @RequestParam String date,
@ApiParam(value = "分组编码", required = true) @RequestParam String groupCode,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode,
@ApiParam(value = "字典类型") @RequestParam(required = false) String dictType
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyStatistics(date, groupCode, fieldCode, dictType));
}
/**
* 调班
*
......
......@@ -329,8 +329,12 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
public List<Map<String, Object>> queryByCompanyNew(String bizOrgName){
return dutyPersonShiftMapper.queryByCompanyNew(bizOrgName);
}
@Override
public List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType) {
return dutyPersonShiftMapper.dayDutyStatistics(date, groupCode, fieldCode, dictType);
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId");
......
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