|
|
@@ -5,29 +5,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.zd.laboratory.mapper.LabControlMapper">
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.LabControl" id="LabControlResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="triggerModes" column="trigger_modes" />
|
|
|
- <result property="controlType" column="control_type" />
|
|
|
- <result property="joinUserId" column="join_user_id" />
|
|
|
- <result property="userName" column="user_name" />
|
|
|
- <result property="operation" column="operation" />
|
|
|
- <result property="hardwareId" column="hardware_id" />
|
|
|
- <result property="subjectId" column="subject_id" />
|
|
|
- <result property="deptId" column="dept_id" />
|
|
|
- <result property="deptName" column="dept_name" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="userId" column="user_id" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="hardwareType" column="hardware_type" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="triggerModes" column="trigger_modes"/>
|
|
|
+ <result property="controlType" column="control_type"/>
|
|
|
+ <result property="joinUserId" column="join_user_id"/>
|
|
|
+ <result property="userName" column="user_name"/>
|
|
|
+ <result property="operation" column="operation"/>
|
|
|
+ <result property="hardwareId" column="hardware_id"/>
|
|
|
+ <result property="subjectId" column="subject_id"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="hardwareType" column="hardware_type"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.vo.LabControlVO" id="LabControlVOResult">
|
|
|
- <result property="subjectName" column="subject_name" />
|
|
|
- <result property="hardwareType" column="hardware_type" typeHandler="org.apache.ibatis.type.EnumOrdinalTypeHandler" />
|
|
|
-<!-- <result property="hardwareTypeEnum" column="hardware_type_enum" />-->
|
|
|
+ <result property="subjectName" column="subject_name"/>
|
|
|
+ <result property="hardwareType" column="hardware_type"
|
|
|
+ typeHandler="org.apache.ibatis.type.EnumOrdinalTypeHandler"/>
|
|
|
+ <!-- <result property="hardwareTypeEnum" column="hardware_type_enum" />-->
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
@@ -50,11 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cl.update_by,
|
|
|
cl.remark,
|
|
|
cl.hardware_type,
|
|
|
(select s.name from lab_subject s where s.id = subject_id) subject_name,
|
|
|
dt.dept_name
|
|
|
from
|
|
|
@@ -216,223 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
)x2 ON x1.yearMonth = x2.yearMonth
|
|
|
-
|
|
|
GROUP BY x1.yearMonth
|
|
|
-
|
|
|
- <!--SELECT '' hardware_type_enum,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 11 MONTH)),'月') month_one,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 10 MONTH)),'月') month_two,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 9 MONTH)),'月') month_three,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 8 MONTH)),'月') month_four,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 7 MONTH)),'月') month_five,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 6 MONTH)),'月') month_six,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 5 MONTH)),'月') month_seven,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 4 MONTH)),'月') month_eight,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 3 MONTH)),'月') month_nine,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 2 MONTH)),'月') month_ten,-->
|
|
|
- <!--CONCAT(MONTH(DATE_SUB(CURDATE(),INTERVAL 1 MONTH)),'月') month_eleven,-->
|
|
|
- <!--CONCAT(MONTH(CURDATE()),'月') month_twelve-->
|
|
|
- <!--FROM DUAL-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--select x1.hardware_type_enum,ifnull(x2.month_one,0) month_one,ifnull(x2.month_two,0) month_two,IFNULL(x2.month_three,0) month_three,IFNULL(x2.month_four,0) month_four,-->
|
|
|
- <!--IFNULL(x2.month_five,0) month_five,IFNULL(x2.month_six,0) month_six,IFNULL(x2.month_seven,0) month_seven,IFNULL(x2.month_eight,0) month_eight,-->
|
|
|
- <!--IFNULL(x2.month_nine,0) month_nine,IFNULL(x2.month_ten,0) month_ten,IFNULL(x2.month_eleven,0) month_eleven,IFNULL(x2.month_twelve,0) month_twelve from (-->
|
|
|
- <!--select 0 hardware_type_enum from dual-->
|
|
|
- <!--union all-->
|
|
|
- <!--SELECT 3 hardware_type_enum FROM DUAL-->
|
|
|
- <!--UNION ALL-->
|
|
|
- <!--SELECT 4 hardware_type_enum FROM DUAL-->
|
|
|
- <!--UNION ALL-->
|
|
|
- <!--SELECT 5 hardware_type_enum FROM DUAL-->
|
|
|
- <!--)x1 left join (-->
|
|
|
- <!--SELECT x1.type hardware_type_enum,x1.month_one,x1.month_two,x1.month_three,x1.month_four,x1.month_five,x1.month_six,x1.month_seven,-->
|
|
|
- <!--x1.month_eight,x1.month_nine,x1.month_ten,x1.month_eleven,x1.month_twelve-->
|
|
|
- <!--FROM (-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,COUNT(1) month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 11 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,COUNT(1) month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 10 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,COUNT(1) month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 9 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,COUNT(1) month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 8 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,COUNT(1) month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 7 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,COUNT(1) month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 6 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,COUNT(1) month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 5 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,COUNT(1) month_eight,0 month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 4 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,COUNT(1) month_nine,0 month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 3 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,COUNT(1) month_ten,0 month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 2 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,COUNT(1) month_eleven,0 month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(DATE_SUB(CURDATE(),INTERVAL 1 MONTH), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--UNION ALL-->
|
|
|
-
|
|
|
- <!--SELECT c.`risk_status` type,0 month_one,0 month_two,0 month_three,0 month_four,0 month_five,0 month_six,0 month_seven-->
|
|
|
- <!--,0 month_eight,0 month_nine,0 month_ten,0 month_eleven,COUNT(1) month_twelve-->
|
|
|
- <!--FROM lab_risk_plan_abnormal_log c,lab_subject s-->
|
|
|
- <!--<where>-->
|
|
|
- <!--AND c.subject_id = s.id AND c.`risk_status` in(0,3,4,5)-->
|
|
|
- <!--AND DATE_FORMAT(CURDATE(), '%Y%m') = DATE_FORMAT(c.create_time, '%Y%m')-->
|
|
|
- <!--<if test="deptId != null ">-->
|
|
|
- <!--and (s.`build_id` =#{deptId} OR s.`build_id` IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET(#{deptId},-->
|
|
|
- <!--ancestors) ))-->
|
|
|
- <!--</if>-->
|
|
|
- <!--GROUP BY c.`risk_status`-->
|
|
|
- <!--</where>-->
|
|
|
-
|
|
|
- <!--)x1 GROUP BY x1.type-->
|
|
|
- <!--)x2 on x1.hardware_type_enum = x2.hardware_type_enum-->
|
|
|
-
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@@ -477,13 +257,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
|
AND date_format(gp.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
|
</if>
|
|
|
- <!--<if test="(beginTimeStr == null or beginTimeStr == '') and (endTimeStr == null or endTimeStr == '')">-->
|
|
|
- <!--AND DATE_FORMAT(gp.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
- <!--</if>-->
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
ORDER BY gp.create_time DESC
|
|
|
-
|
|
|
</select>
|
|
|
</mapper>
|