mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 17:09:36 +08:00
增加查询条件
This commit is contained in:
parent
a73e5c6e54
commit
a6098c8b53
@ -114,6 +114,9 @@ public class RepairController extends BaseController {
|
||||
* room:门牌号,模糊查询
|
||||
* explain:描述,模糊查询
|
||||
* failureTypeId:故障类型id,精确查询
|
||||
* remark: yes 5110工单 no 普通工单
|
||||
* evalService: 1 好评 2 中评 3 差评,其他值无效
|
||||
* timeout: 9 查询超时工单,其他值无效
|
||||
* beginTime : 工单创建日期范围;开始时间;格式示例 2024-08-22;成对出现
|
||||
* endTime : 工单创建日期范围;结束时间;格式示例 2024-08-25;成对出现
|
||||
*
|
||||
|
@ -38,10 +38,25 @@ public class RepairStatsController extends BaseController {
|
||||
|
||||
/**
|
||||
* 人员绩效,维修人员
|
||||
* 支持查询参数:
|
||||
* username 姓名
|
||||
* mobile 手机号
|
||||
* typeid 设备类型id
|
||||
* startDate 工单创建日期范围;开始时间;格式示例 2024-08-22;成对出现
|
||||
* endDate 工单创建日期范围;结束时间;格式示例 2024-08-25;成对出现
|
||||
*
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("workerList")
|
||||
public R workerList(RepairWorkerStatsVo repairWorkerStatsVo) {
|
||||
try {
|
||||
if (StringUtils.isNotBlank(repairWorkerStatsVo.getStartDate()) && StringUtils.isNotBlank(repairWorkerStatsVo.getEndDate())) {
|
||||
repairWorkerStatsVo.setStart(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, repairWorkerStatsVo.getStartDate() + " 00:00:00"));
|
||||
repairWorkerStatsVo.setEnd(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, repairWorkerStatsVo.getEndDate() + " 23:59:59"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.error("参数错误");
|
||||
}
|
||||
startPage();
|
||||
return result(repairWorkerStatsService.selectRepairWorkerStatsList(repairWorkerStatsVo));
|
||||
}
|
||||
@ -64,10 +79,27 @@ public class RepairStatsController extends BaseController {
|
||||
|
||||
/**
|
||||
* 人员绩效,楼层管理员
|
||||
*
|
||||
* 支持查询参数:
|
||||
* username 姓名
|
||||
* mobile 手机号
|
||||
* adr 地址名称,地点,楼层等
|
||||
* startDate 工单创建日期范围;开始时间;格式示例 2024-08-22;成对出现
|
||||
* endDate 工单创建日期范围;结束时间;格式示例 2024-08-25;成对出现
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("floorList")
|
||||
public R floorList(RepairFloorStatsVo repairFloorStatsVo) {
|
||||
try {
|
||||
if (StringUtils.isNotBlank(repairFloorStatsVo.getStartDate()) && StringUtils.isNotBlank(repairFloorStatsVo.getEndDate())) {
|
||||
Date start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, repairFloorStatsVo.getStartDate() + " 00:00:00");
|
||||
repairFloorStatsVo.setStart(start);
|
||||
Date end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, repairFloorStatsVo.getEndDate() + " 23:59:59");
|
||||
repairFloorStatsVo.setEnd(end);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.error("参数错误");
|
||||
}
|
||||
startPage();
|
||||
return result(repairWorkerStatsService.selectRepairFloorStatsVoList(repairFloorStatsVo));
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.ics.admin.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 对应视图floor_stats
|
||||
@ -73,4 +75,16 @@ public class RepairFloorStatsVo implements Serializable {
|
||||
* 差评
|
||||
*/
|
||||
private String l;
|
||||
|
||||
@JsonIgnore
|
||||
private String startDate;
|
||||
|
||||
@JsonIgnore
|
||||
private Date start;
|
||||
|
||||
@JsonIgnore
|
||||
private String endDate;
|
||||
|
||||
@JsonIgnore
|
||||
private Date end;
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.ics.admin.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 对应视图worker_stats
|
||||
@ -54,4 +56,16 @@ public class RepairWorkerStatsVo implements Serializable {
|
||||
|
||||
/** 差评 */
|
||||
private String l;
|
||||
|
||||
@JsonIgnore
|
||||
private String startDate;
|
||||
|
||||
@JsonIgnore
|
||||
private Date start;
|
||||
|
||||
@JsonIgnore
|
||||
private String endDate;
|
||||
|
||||
@JsonIgnore
|
||||
private Date end;
|
||||
}
|
||||
|
@ -250,6 +250,12 @@
|
||||
<if test="room != null and room != ''"> AND rep.room LIKE CONCAT('%', #{room}, '%')</if>
|
||||
<if test="explain != null and explain != ''"> AND rep.`explain` LIKE CONCAT('%', #{explain}, '%')</if>
|
||||
<if test="failureTypeId != null"> AND rep.failure_type_id = #{failureTypeId}</if>
|
||||
<if test="remark != null and remark=='yes'"> AND rep.remark = '5110'</if>
|
||||
<if test="remark != null and remark=='no'"> AND rep.remark is null</if>
|
||||
<if test="evalService != null and evalService==1"> AND rep.eval_service >= 4</if>
|
||||
<if test="evalService != null and evalService==2"> AND rep.eval_service = 3</if>
|
||||
<if test="evalService != null and evalService==3"> AND rep.eval_service <= 2</if>
|
||||
<if test="timeout != null and timeout==9"> and predate < now() and status < 9</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
@ -3,13 +3,41 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ics.admin.mapper.RepairStatsMapper">
|
||||
|
||||
<!-- 人员绩效 维修工 -->
|
||||
<select id="selectRepairWorkerStatsList" parameterType="com.ics.admin.vo.RepairWorkerStatsVo" resultType="com.ics.admin.vo.RepairWorkerStatsVo">
|
||||
SELECT id, username, mobile, typeid, typename, zs, process, closed, Unresolved, pj,
|
||||
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
||||
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
||||
case when pj>0 then CONCAT(l,',',ROUND(l/pj*100,1),'%') else '0,0%' end as l
|
||||
FROM worker_stats
|
||||
FROM
|
||||
<![CDATA[
|
||||
(
|
||||
select
|
||||
user.id,user.username username,user.mobile,dt.id typeid,dt.name typename,
|
||||
count(rep.id) as zs,
|
||||
SUM(case when rep.status=5 or rep.status=7 then 1 else 0 end) as process,
|
||||
SUM(case when rep.status=9 or rep.status=13 then 1 else 0 end) as closed,
|
||||
SUM(case when rep.resolve=0 then 1 else 0 end) as Unresolved,
|
||||
count(rep.eval_service) pj,
|
||||
SUM(case when rep.eval_service>=4 then 1 else 0 end) as h,
|
||||
SUM(case when rep.eval_service=3 then 1 else 0 end) as m,
|
||||
SUM(case when rep.eval_service<=2 then 1 else 0 end) as l
|
||||
from
|
||||
ics_customer_staff user, ics_repair rep, ics_repair_device_type dt
|
||||
where
|
||||
user.delete_flag=0 and rep.delete_flag=0 and dt.delete_flag=0
|
||||
and user.id=rep.repair_user_id and rep.type_id=dt.id
|
||||
]]>
|
||||
<if test="start != null and end != null">
|
||||
and rep.create_time between #{start} and #{end}
|
||||
</if>
|
||||
<![CDATA[
|
||||
and (rep.status=5 or rep.status=7 or rep.status=9 or rep.status=13)
|
||||
GROUP BY
|
||||
user.id,user.name,user.mobile,dt.id,dt.name
|
||||
) tb
|
||||
|
||||
]]>
|
||||
<where>
|
||||
<if test="username != null and username != ''">AND username LIKE CONCAT('%', #{username}, '%')</if>
|
||||
<if test="mobile != null and mobile != ''">AND mobile LIKE CONCAT('%', #{mobile}, '%')</if>
|
||||
@ -17,12 +45,38 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 人员绩效 楼层管理员 -->
|
||||
<select id="selectRepairFloorStatsVoList" parameterType="com.ics.admin.vo.RepairFloorStatsVo" resultType="com.ics.admin.vo.RepairFloorStatsVo">
|
||||
SELECT id, name, mobile, adr, zs, process, closed, Unresolved, pj,
|
||||
case when pj>0 then CONCAT(h,',',ROUND(h/pj*100,1),'%') else '0,0%' end as h,
|
||||
case when pj>0 then CONCAT(m,',',ROUND(m/pj*100,1),'%') else '0,0%' end as m,
|
||||
case when pj>0 then CONCAT(l,',',ROUND(l/pj*100,1),'%') else '0,0%' end as l
|
||||
FROM floor_stats
|
||||
FROM
|
||||
<![CDATA[
|
||||
(
|
||||
select user.id,user.username name,user.mobile,group_concat(DISTINCT CONCAT(ad.name,'/',floor.name)) adr,
|
||||
count(rep.id) as zs,
|
||||
SUM(case when rep.status<9 then 1 else 0 end) as process,
|
||||
SUM(case when rep.status>=9 then 1 else 0 end) as closed,
|
||||
SUM(case when rep.resolve=0 then 1 else 0 end) as Unresolved,
|
||||
count(rep.eval_service) pj,
|
||||
SUM(case when rep.eval_service>=4 then 1 else 0 end) as h,
|
||||
SUM(case when rep.eval_service=3 then 1 else 0 end) as m,
|
||||
SUM(case when rep.eval_service<=2 then 1 else 0 end) as l
|
||||
from
|
||||
ics_customer_staff user, ics_repair_address ad, ics_repair_address_floor floor, ics_repair rep
|
||||
where
|
||||
user.delete_flag=0 and floor.delete_flag=0 and rep.delete_flag=0 and ad.delete_flag=0
|
||||
and user.id=floor.admin_id and floor.address_id=ad.id and floor.id=rep.floor_id
|
||||
]]>
|
||||
<if test="start != null and end != null">
|
||||
and rep.create_time between #{start} and #{end}
|
||||
</if>
|
||||
<![CDATA[
|
||||
GROUP BY
|
||||
user.id,user.name,user.mobile
|
||||
) tb
|
||||
]]>
|
||||
<where>
|
||||
<if test="name != null and name != ''">AND name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="mobile != null and mobile != ''">AND mobile LIKE CONCAT('%', #{mobile}, '%')</if>
|
||||
@ -39,7 +93,7 @@
|
||||
case when pj>0 then CONCAT(l,',',ROUND(l/pj*100,1),'%') else '0,0%' end as l
|
||||
FROM
|
||||
(
|
||||
select user.id,user.name,user.mobile,
|
||||
select user.id,user.username name,user.mobile,
|
||||
count(rep.id) as zs,
|
||||
SUM(case when rep.status<9 then 1 else 0 end) as process,
|
||||
SUM(case when rep.status>=9 then 1 else 0 end) as closed,
|
||||
|
@ -1,6 +1,6 @@
|
||||
CREATE VIEW worker_stats AS
|
||||
select
|
||||
user.id,user.name username,user.mobile,dt.id typeid,dt.name typename,
|
||||
user.id,user.username username,user.mobile,dt.id typeid,dt.name typename,
|
||||
count(rep.id) as zs,
|
||||
SUM(case when rep.status=5 or rep.status=7 then 1 else 0 end) as process,
|
||||
SUM(case when rep.status=9 or rep.status=13 then 1 else 0 end) as closed,
|
||||
@ -20,7 +20,7 @@ GROUP BY
|
||||
|
||||
|
||||
CREATE VIEW floor_stats AS
|
||||
select user.id,user.name,user.mobile,group_concat(DISTINCT CONCAT(ad.name,'/',floor.name)) adr,
|
||||
select user.id,user.username name,user.mobile,group_concat(DISTINCT CONCAT(ad.name,'/',floor.name)) adr,
|
||||
count(rep.id) as zs,
|
||||
SUM(case when rep.status<9 then 1 else 0 end) as process,
|
||||
SUM(case when rep.status>=9 then 1 else 0 end) as closed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user