|
@@ -5,54 +5,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.zd.laboratory.mapper.LabViolationMapper">
|
|
<mapper namespace="com.zd.laboratory.mapper.LabViolationMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.LabViolation" id="LabViolationResult">
|
|
<resultMap type="com.zd.laboratory.domain.LabViolation" id="LabViolationResult">
|
|
|
- <result property="id" column="id" />
|
|
|
|
|
- <result property="joinUserId" column="join_user_id" />
|
|
|
|
|
- <result property="violationType" column="violation_type" />
|
|
|
|
|
- <result property="violationContent" column="violation_content" />
|
|
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
|
|
- <result property="deptId" column="dept_id" />
|
|
|
|
|
- <result property="deptName" column="dept_name" />
|
|
|
|
|
- <result property="userId" column="user_id" />
|
|
|
|
|
- <result property="remark" column="remark" />
|
|
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
|
|
- <result property="penaltyType" column="penalty_type" />
|
|
|
|
|
- <result property="isHandle" column="is_handle" />
|
|
|
|
|
- <result property="subjectId" column="subject_id" />
|
|
|
|
|
- <result property="stuNo" column="stu_no" />
|
|
|
|
|
- <result property="belongCollege" column="belong_college" />
|
|
|
|
|
- <result property="status" column="status" />
|
|
|
|
|
- <result property="violationNum" column="violation_num" />
|
|
|
|
|
- <result property="negativeListNum" column="negative_list_num" />
|
|
|
|
|
- <result property="blackListNum" column="black_list_num" />
|
|
|
|
|
- <result property="isNegative" column="is_negative" />
|
|
|
|
|
- <result property="isBlackList" column="is_black_list" />
|
|
|
|
|
- <result property="creact_id" column="creact_id" />
|
|
|
|
|
|
|
+ <result property="id" column="id"/>
|
|
|
|
|
+ <result property="joinUserId" column="join_user_id"/>
|
|
|
|
|
+ <result property="violationType" column="violation_type"/>
|
|
|
|
|
+ <result property="violationContent" column="violation_content"/>
|
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
|
|
+ <result property="penaltyType" column="penalty_type"/>
|
|
|
|
|
+ <result property="isHandle" column="is_handle"/>
|
|
|
|
|
+ <result property="subjectId" column="subject_id"/>
|
|
|
|
|
+ <result property="stuNo" column="stu_no"/>
|
|
|
|
|
+ <result property="belongCollege" column="belong_college"/>
|
|
|
|
|
+ <result property="status" column="status"/>
|
|
|
|
|
+ <result property="violationNum" column="violation_num"/>
|
|
|
|
|
+ <result property="negativeListNum" column="negative_list_num"/>
|
|
|
|
|
+ <result property="blackListNum" column="black_list_num"/>
|
|
|
|
|
+ <result property="isNegative" column="is_negative"/>
|
|
|
|
|
+ <result property="isBlackList" column="is_black_list"/>
|
|
|
|
|
+ <result property="creact_id" column="creact_id"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.vo.LabViolationVO" id="LabViolationVOResult">
|
|
<resultMap type="com.zd.laboratory.domain.vo.LabViolationVO" id="LabViolationVOResult">
|
|
|
- <result property="subjectName" column="subject_name" />
|
|
|
|
|
- <result property="userName" column="user_name" />
|
|
|
|
|
- <result property="violCount" column="viol_count" />
|
|
|
|
|
- <result property="untreatedCount" column="untreated_count" />
|
|
|
|
|
- <result property="lastViolTime" column="last_viol_time" />
|
|
|
|
|
- <result property="lastHandleTime" column="last_handle_time" />
|
|
|
|
|
- <!-- <result property="stuNo" column="stu_no" />-->
|
|
|
|
|
- <result property="belongCollege" column="belong_college" />
|
|
|
|
|
- <result property="status" column="status" />
|
|
|
|
|
- <result property="violationNum" column="violation_num" />
|
|
|
|
|
- <result property="negativeListNum" column="negative_list_num" />
|
|
|
|
|
- <result property="blackListNum" column="black_list_num" />
|
|
|
|
|
- <result property="violationNum" column="violation_num" />
|
|
|
|
|
- <result property="creditScore" column="credit_score" />
|
|
|
|
|
- <result property="isNegative" column="is_negative" />
|
|
|
|
|
- <result property="isBlackList" column="is_black_list" />
|
|
|
|
|
- <result property="avatar" column="avatar"/>
|
|
|
|
|
- <result property="totalPoints" column="total_points"/>
|
|
|
|
|
- <result property="bonusPoints" column="bonus_points"/>
|
|
|
|
|
- <result property="creact_id" column="creact_id" />
|
|
|
|
|
- <result property="negativeId" column="negative_id" />
|
|
|
|
|
|
|
+ <result property="subjectName" column="subject_name"/>
|
|
|
|
|
+ <result property="userName" column="user_name"/>
|
|
|
|
|
+ <result property="violCount" column="viol_count"/>
|
|
|
|
|
+ <result property="untreatedCount" column="untreated_count"/>
|
|
|
|
|
+ <result property="lastViolTime" column="last_viol_time"/>
|
|
|
|
|
+ <result property="lastHandleTime" column="last_handle_time"/>
|
|
|
|
|
+ <!-- <result property="stuNo" column="stu_no"/>-->
|
|
|
|
|
+ <result property="belongCollege" column="belong_college"/>
|
|
|
|
|
+ <result property="status" column="status"/>
|
|
|
|
|
+ <result property="violationNum" column="violation_num"/>
|
|
|
|
|
+ <result property="negativeListNum" column="negative_list_num"/>
|
|
|
|
|
+ <result property="blackListNum" column="black_list_num"/>
|
|
|
|
|
+ <result property="violationNum" column="violation_num"/>
|
|
|
|
|
+ <result property="creditScore" column="credit_score"/>
|
|
|
|
|
+ <result property="isNegative" column="is_negative"/>
|
|
|
|
|
+ <result property="isBlackList" column="is_black_list"/>
|
|
|
|
|
+ <result property="avatar" column="avatar"/>
|
|
|
|
|
+ <result property="totalPoints" column="total_points"/>
|
|
|
|
|
+ <result property="bonusPoints" column="bonus_points"/>
|
|
|
|
|
+ <result property="creact_id" column="creact_id"/>
|
|
|
|
|
+ <result property="negativeId" column="negative_id"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
@@ -149,7 +149,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
</where>
|
|
</where>
|
|
|
order by t.id DESC
|
|
order by t.id DESC
|
|
|
-
|
|
|
|
|
<if test="size != null "> limit 0 ,#{size} </if>
|
|
<if test="size != null "> limit 0 ,#{size} </if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -270,13 +269,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="mylist" parameterType="com.zd.laboratory.domain.vo.LabViolationVO" resultMap="LabViolationVOResult">
|
|
<select id="mylist" parameterType="com.zd.laboratory.domain.vo.LabViolationVO" resultMap="LabViolationVOResult">
|
|
|
<include refid="selectListVo"/>
|
|
<include refid="selectListVo"/>
|
|
|
<where>
|
|
<where>
|
|
|
- <if test="joinUserId != null "> and t.join_user_id = #{joinUserId}</if>
|
|
|
|
|
- <if test="violationType != null "> and t.violation_type = #{violationType}</if>
|
|
|
|
|
- <if test="violationContent != null and violationContent != ''"> and t.violation_content = #{violationContent}</if>
|
|
|
|
|
- <if test="deptId != null "> and t.dept_id = #{deptId}</if>
|
|
|
|
|
- <if test="deptName != null and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
- <if test="userId != null "> and t.user_id = #{userId}</if>
|
|
|
|
|
- <if test="isHandle != null "> and t.is_handle = #{isHandle}</if>
|
|
|
|
|
|
|
+ <if test="joinUserId != null ">and t.join_user_id = #{joinUserId}</if>
|
|
|
|
|
+ <if test="violationType != null ">and t.violation_type = #{violationType}</if>
|
|
|
|
|
+ <if test="violationContent != null and violationContent != ''">and t.violation_content = #{violationContent}</if>
|
|
|
|
|
+ <if test="deptId != null ">and t.dept_id = #{deptId}</if>
|
|
|
|
|
+ <if test="deptName != null and deptName != ''">and t.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
+ <if test="userId != null ">and t.user_id = #{userId}</if>
|
|
|
|
|
+ <if test="isHandle != null ">and t.is_handle = #{isHandle}</if>
|
|
|
<if test="beginTime != null ">
|
|
<if test="beginTime != null ">
|
|
|
and str_to_date(t.create_time,'%Y-%m-%d') >= #{beginTime}
|
|
and str_to_date(t.create_time,'%Y-%m-%d') >= #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
@@ -288,9 +287,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="statistics" resultType="java.util.Map">
|
|
<select id="statistics" resultType="java.util.Map">
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
SELECT dd.id AS type, dd.violation_name AS content, IFNULL( lv.num, 0) AS count
|
|
SELECT dd.id AS type, dd.violation_name AS content, IFNULL( lv.num, 0) AS count
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT ss.`id`,ss.violation_name FROM lab_violation_score_site ss
|
|
SELECT ss.`id`,ss.violation_name FROM lab_violation_score_site ss
|
|
@@ -302,9 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM lab_negativelist_history v INNER JOIN lab_subject t ON v.`laboratory_id` = t.`id`
|
|
FROM lab_negativelist_history v INNER JOIN lab_subject t ON v.`laboratory_id` = t.`id`
|
|
|
INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
|
|
INNER JOIN lab_violation_score_site vs ON v.`reason` = vs.`violation_name`
|
|
|
where DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')
|
|
where DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')
|
|
|
-
|
|
|
|
|
UNION ALL
|
|
UNION ALL
|
|
|
-
|
|
|
|
|
SELECT '其他' violation_type , v.`id` num,t.`build_id` dept_id
|
|
SELECT '其他' violation_type , v.`id` num,t.`build_id` dept_id
|
|
|
FROM lab_negativelist_history v INNER JOIN lab_subject t ON v.`laboratory_id` = t.`id`
|
|
FROM lab_negativelist_history v INNER JOIN lab_subject t ON v.`laboratory_id` = t.`id`
|
|
|
WHERE v.reason NOT IN(
|
|
WHERE v.reason NOT IN(
|
|
@@ -319,43 +313,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
GROUP BY t.violation_type
|
|
GROUP BY t.violation_type
|
|
|
) lv ON dd.violation_name = lv.violation_type
|
|
) lv ON dd.violation_name = lv.violation_type
|
|
|
ORDER BY COUNT DESC
|
|
ORDER BY COUNT DESC
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!--SELECT dd.dict_value AS type, dd.dict_label AS content, IFNULL( lv.num, 0) AS count-->
|
|
|
|
|
- <!--FROM sys_dict_data dd LEFT JOIN (-->
|
|
|
|
|
- <!--SELECT t.violation_type , COUNT(1) num FROM (-->
|
|
|
|
|
- <!--SELECT v.violation_type , v.`id` num,t.`build_id` dept_id-->
|
|
|
|
|
- <!--FROM lab_violation v INNER JOIN lab_subject t ON v.`subject_id` = t.`id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--) t-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--1=1-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--GROUP BY t.violation_type-->
|
|
|
|
|
- <!--) lv ON dd.dict_value = lv.violation_type-->
|
|
|
|
|
- <!--WHERE dd.dict_type = "lab_violation_rules"-->
|
|
|
|
|
-
|
|
|
|
|
- <!--ORDER BY count DESC-->
|
|
|
|
|
-
|
|
|
|
|
- <!--select dd.dict_value as type, dd.dict_label as content, ifnull( lv.num, 0) as count-->
|
|
|
|
|
- <!--from sys_dict_data dd left join (-->
|
|
|
|
|
- <!--select violation_type , count(1) num-->
|
|
|
|
|
- <!--from lab_violation-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>-->
|
|
|
|
|
- <!--<if test="buildId != null ">-->
|
|
|
|
|
- <!--AND (subject_id IN ( SELECT id FROM lab_subject WHERE build_id = #{buildId} ))-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--group by violation_type) lv on dd.dict_value = lv.violation_type-->
|
|
|
|
|
- <!--where dd.dict_type = "lab_violation_rules"-->
|
|
|
|
|
-
|
|
|
|
|
- <!--order by count desc-->
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="columnar" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">
|
|
<select id="columnar" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">
|
|
@@ -399,58 +356,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <!--<if test="(beginTimeStr == null or beginTimeStr == '') and (endTimeStr == null or endTimeStr == '')">-->
|
|
|
|
|
- <!--AND DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!-- 数据范围过滤 -->
|
|
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
</where>
|
|
</where>
|
|
|
)x1 ON dd.violation_name = x1.violation_type INNER JOIN sys_dept dt ON x1.deptGroup = dt.dept_id
|
|
)x1 ON dd.violation_name = x1.violation_type INNER JOIN sys_dept dt ON x1.deptGroup = dt.dept_id
|
|
|
GROUP BY x1.deptGroup,x1.violation_type
|
|
GROUP BY x1.deptGroup,x1.violation_type
|
|
|
)xx2 ON xx1.currencyId = xx2.currencyId ORDER BY num DESC
|
|
)xx2 ON xx1.currencyId = xx2.currencyId ORDER BY num DESC
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!--select xx1.currencyId,xx1.currencyName,xx2.type,xx2.content,IFNULL(xx2.num,0) num from (-->
|
|
|
|
|
- <!--SELECT dt.`dept_id` currencyId,dt.`dept_name` currencyName-->
|
|
|
|
|
- <!--FROM sys_dept d JOIN sys_dept dt ON d.dept_id = dt.parent_id-->
|
|
|
|
|
- <!--WHERE d.parent_id = 0-->
|
|
|
|
|
- <!--)xx1 left join (-->
|
|
|
|
|
- <!--SELECT dd.dict_value AS TYPE, dd.dict_label AS content,IFNULL(COUNT(1),0) num,x1.deptGroup currencyId,dt.`dept_name` currencyName-->
|
|
|
|
|
- <!--FROM sys_dict_data dd LEFT JOIN-->
|
|
|
|
|
- <!--(-->
|
|
|
|
|
- <!--SELECT v.id,v.`violation_type`,s.build_id dept_id,t.parent_id,t.`ancestors`,-->
|
|
|
|
|
- <!--(SELECT dt.`dept_id`-->
|
|
|
|
|
- <!--FROM sys_dept d JOIN sys_dept dt ON d.dept_id = dt.parent_id-->
|
|
|
|
|
- <!--WHERE d.parent_id = 0 AND FIND_IN_SET(dt.dept_id,t.`ancestors`)) deptGroup-->
|
|
|
|
|
- <!--FROM sys_dept t INNER JOIN lab_subject s ON t.`dept_id` = s.`build_id` INNER JOIN lab_violation v ON s.`id` = v.`subject_id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--<if test="schoolDeptId != null ">-->
|
|
|
|
|
- <!--AND (s.build_id = #{schoolDeptId} OR s.build_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{schoolDeptId},-->
|
|
|
|
|
- <!--ancestors) ))-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="violationType != null "> and v.`violation_type` = #{violationType}</if>-->
|
|
|
|
|
- <!--<if test="beginTimeStr != null and beginTimeStr != ''"><!– 开始时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.create_time,'%y%m%d') >= date_format(#{beginTimeStr},'%y%m%d')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="endTimeStr != null and endTimeStr != ''"><!– 结束时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.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(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')–>-->
|
|
|
|
|
- <!--<!–</if>–>-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--)x1 ON dd.dict_value = x1.violation_type INNER JOIN sys_dept dt ON x1.deptGroup = dt.dept_id-->
|
|
|
|
|
- <!--WHERE dd.dict_type = "lab_violation_rules"-->
|
|
|
|
|
- <!--GROUP BY x1.deptGroup,x1.violation_type-->
|
|
|
|
|
- <!--)xx2 ON xx1.currencyId = xx2.currencyId ORDER BY num desc-->
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="columnarBySub" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">
|
|
<select id="columnarBySub" resultType="com.zd.laboratory.domain.vo.LabViolationColumnarVO">
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
SELECT xs1.currencyId,xs1.currencyName,xs2.type,xs2.content,IFNULL(xs2.num,0) num FROM (
|
|
SELECT xs1.currencyId,xs1.currencyName,xs2.type,xs2.content,IFNULL(xs2.num,0) num FROM (
|
|
|
SELECT x2.subjectId currencyId,IFNULL(COUNT(1),0) num,x2.subjectName currencyName FROM (
|
|
SELECT x2.subjectId currencyId,IFNULL(COUNT(1),0) num,x2.subjectName currencyName FROM (
|
|
|
SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName
|
|
SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName
|
|
@@ -533,68 +447,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <!--<if test="(beginTimeStr == null or beginTimeStr == '') and (endTimeStr == null or endTimeStr == '')">-->
|
|
|
|
|
- <!--AND DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!-- 数据范围过滤 -->
|
|
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
</where>
|
|
</where>
|
|
|
)x1 ON dd.violation_name = x1.violation_type
|
|
)x1 ON dd.violation_name = x1.violation_type
|
|
|
GROUP BY x1.subjectId,x1.violation_type
|
|
GROUP BY x1.subjectId,x1.violation_type
|
|
|
)xx2 ON xx1.subjectId = xx2.subjectId
|
|
)xx2 ON xx1.subjectId = xx2.subjectId
|
|
|
-
|
|
|
|
|
)xs2 ON xs1.currencyId = xs2.currencyId ORDER BY num DESC,xs1.currencyId DESC
|
|
)xs2 ON xs1.currencyId = xs2.currencyId ORDER BY num DESC,xs1.currencyId DESC
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!--SELECT xs1.currencyId,xs1.currencyName,xs2.type,xs2.content,IFNULL(xs2.num,0) num FROM (-->
|
|
|
|
|
- <!--SELECT s.id currencyId,s.`name` currencyName-->
|
|
|
|
|
- <!--FROM sys_dept t INNER JOIN lab_subject s ON t.`dept_id` = s.`build_id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--1=1-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--)xs1 LEFT JOIN (-->
|
|
|
|
|
-
|
|
|
|
|
- <!--select xx2.type,xx2.content,xx2.num,xx2.subjectId currencyId,xx2.subjectName currencyName from (select x2.subjectId,IFNULL(COUNT(1),0) num from (-->
|
|
|
|
|
- <!--SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName-->
|
|
|
|
|
- <!--FROM sys_dept t INNER JOIN lab_subject s ON t.`dept_id` = s.`build_id` INNER JOIN lab_violation v ON s.`id` = v.`subject_id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--1=1-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--)x2 GROUP BY x2.subjectId order by num desc LIMIT 10)xx1-->
|
|
|
|
|
- <!--inner join (-->
|
|
|
|
|
- <!--SELECT dd.dict_value AS TYPE, dd.dict_label AS content,IFNULL(COUNT(1),0) num,x1.subjectId subjectId,x1.`subjectName` subjectName-->
|
|
|
|
|
- <!--FROM sys_dict_data dd INNER JOIN-->
|
|
|
|
|
- <!--(-->
|
|
|
|
|
- <!--SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName-->
|
|
|
|
|
- <!--FROM sys_dept t INNER JOIN lab_subject s ON t.`dept_id` = s.`build_id` INNER JOIN lab_violation v ON s.`id` = v.`subject_id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--<if test="subjectId != null ">-->
|
|
|
|
|
- <!--AND s.`id` = #{subjectId}-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="violationType != null "> and v.`violation_type` = #{violationType}</if>-->
|
|
|
|
|
- <!--<if test="beginTimeStr != null and beginTimeStr != ''"><!– 开始时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.create_time,'%y%m%d') >= date_format(#{beginTimeStr},'%y%m%d')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="endTimeStr != null and endTimeStr != ''"><!– 结束时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.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(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')–>-->
|
|
|
|
|
- <!--<!–</if>–>-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--)x1 ON dd.dict_value = x1.violation_type-->
|
|
|
|
|
- <!--WHERE dd.dict_type = "lab_violation_rules"-->
|
|
|
|
|
- <!--GROUP BY x1.subjectId,x1.violation_type-->
|
|
|
|
|
- <!--)xx2 on xx1.subjectId = xx2.subjectId-->
|
|
|
|
|
-
|
|
|
|
|
- <!--)xs2 ON xs1.currencyId = xs2.currencyId ORDER BY num DESC LIMIT 10-->
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -604,7 +462,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT ss.`id`,ss.violation_name FROM lab_violation_score_site ss
|
|
SELECT ss.`id`,ss.violation_name FROM lab_violation_score_site ss
|
|
|
UNION ALL
|
|
UNION ALL
|
|
|
SELECT '-99' id,'其他' violation_name FROM DUAL
|
|
SELECT '-99' id,'其他' violation_name FROM DUAL
|
|
|
-
|
|
|
|
|
) dd INNER JOIN
|
|
) dd INNER JOIN
|
|
|
(
|
|
(
|
|
|
SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName,
|
|
SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName,
|
|
@@ -633,45 +490,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
<if test="endTimeStr != null and endTimeStr != ''"><!-- 结束时间检索 -->
|
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
AND date_format(v.create_time,'%y%m%d') <= date_format(#{endTimeStr},'%y%m%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <!--<if test="(beginTimeStr == null or beginTimeStr == '') and (endTimeStr == null or endTimeStr == '')">-->
|
|
|
|
|
- <!--AND DATE_FORMAT(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!-- 数据范围过滤 -->
|
|
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
</where>
|
|
</where>
|
|
|
)x1 ON dd.violation_name = x1.violation_type
|
|
)x1 ON dd.violation_name = x1.violation_type
|
|
|
GROUP BY x1.subjectId,x1.violation_type ORDER BY num DESC,x1.subjectId desc
|
|
GROUP BY x1.subjectId,x1.violation_type ORDER BY num DESC,x1.subjectId desc
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!--SELECT dd.dict_value AS TYPE, dd.dict_label AS content,IFNULL(COUNT(1),0) num,x1.subjectId subId,x1.`subjectName` subName,x1.classifiedName,x1.typeName-->
|
|
|
|
|
- <!--FROM sys_dict_data dd INNER JOIN-->
|
|
|
|
|
- <!--(-->
|
|
|
|
|
- <!--SELECT v.id,v.`violation_type`,s.id subjectId,s.`name` subjectName,-->
|
|
|
|
|
- <!--(SELECT sc.classified_name FROM lab_safe_classified sc WHERE sc.id = s.level) AS classifiedName,-->
|
|
|
|
|
- <!--(SELECT sc.type_name FROM lab_safe_classtype sc WHERE sc.id = s.type_id) AS typeName-->
|
|
|
|
|
- <!--FROM sys_dept t INNER JOIN lab_subject s ON t.`dept_id` = s.`build_id` INNER JOIN lab_violation v ON s.`id` = v.`subject_id`-->
|
|
|
|
|
- <!--<where>-->
|
|
|
|
|
- <!--<if test="subjectId != null ">-->
|
|
|
|
|
- <!--AND s.`id` = #{subjectId}-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="violationType != null "> and v.`violation_type` = #{violationType}</if>-->
|
|
|
|
|
- <!--<if test="beginTimeStr != null and beginTimeStr != ''"><!– 开始时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.create_time,'%y%m%d') >= date_format(#{beginTimeStr},'%y%m%d')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<if test="endTimeStr != null and endTimeStr != ''"><!– 结束时间检索 –>-->
|
|
|
|
|
- <!--AND date_format(v.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(v.`create_time`,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')-->
|
|
|
|
|
- <!--</if>-->
|
|
|
|
|
- <!--<!– 数据范围过滤 –>-->
|
|
|
|
|
- <!--${params.dataScope}-->
|
|
|
|
|
- <!--</where>-->
|
|
|
|
|
- <!--)x1 ON dd.dict_value = x1.violation_type-->
|
|
|
|
|
- <!--WHERE dd.dict_type = "lab_violation_rules"-->
|
|
|
|
|
- <!--GROUP BY x1.subjectId,x1.violation_type ORDER BY num DESC-->
|
|
|
|
|
-
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="pageList" parameterType="com.zd.laboratory.domain.vo.LabViolationVO" resultMap="LabViolationVOResult">
|
|
<select id="pageList" parameterType="com.zd.laboratory.domain.vo.LabViolationVO" resultMap="LabViolationVOResult">
|
|
@@ -714,7 +536,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
u.user_name like concat('%', #{searchValue}, '%')
|
|
u.user_name like concat('%', #{searchValue}, '%')
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
|
|
|
|
@@ -815,35 +636,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ON u.`user_id`=r.`join_user_id` WHERE u.user_id=#{userid} GROUP BY u.`user_id`
|
|
ON u.`user_id`=r.`join_user_id` WHERE u.user_id=#{userid} GROUP BY u.`user_id`
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
-<update id="updateblackStatus">
|
|
|
|
|
- update lab_violation SET
|
|
|
|
|
- is_negative='0',
|
|
|
|
|
- is_black_list='1',
|
|
|
|
|
- status='3',
|
|
|
|
|
- black_list_num=black_list_num+1,
|
|
|
|
|
- credit_score=#{deducPoints}
|
|
|
|
|
- WHERE user_id=#{userId}
|
|
|
|
|
-</update>
|
|
|
|
|
-
|
|
|
|
|
-<update id="updateUser" >
|
|
|
|
|
- update lab_violation SET is_negative='0',
|
|
|
|
|
- is_black_list='0',
|
|
|
|
|
- status='1',
|
|
|
|
|
- black_list_num=black_list_num-1
|
|
|
|
|
- ,credit_score=#{deducPoints}
|
|
|
|
|
- WHERE user_id=#{userId}
|
|
|
|
|
-</update>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-<delete id="delByUserId">
|
|
|
|
|
- delete from lab_violation where join_user_id=#{userId}
|
|
|
|
|
-</delete>
|
|
|
|
|
-
|
|
|
|
|
-<select id="checkDeptId" resultType="integer">
|
|
|
|
|
- select *
|
|
|
|
|
- FROM
|
|
|
|
|
- sys_dept d where d.dept_id=#{deptId}
|
|
|
|
|
-</select>
|
|
|
|
|
|
|
+ <update id="updateblackStatus">
|
|
|
|
|
+ update lab_violation
|
|
|
|
|
+ SET is_negative='0',
|
|
|
|
|
+ is_black_list='1',
|
|
|
|
|
+ status='3',
|
|
|
|
|
+ black_list_num=black_list_num + 1,
|
|
|
|
|
+ credit_score=#{deducPoints}
|
|
|
|
|
+ WHERE user_id = #{userId}
|
|
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
|
+ <update id="updateUser">
|
|
|
|
|
+ update lab_violation
|
|
|
|
|
+ SET is_negative='0',
|
|
|
|
|
+ is_black_list='0',
|
|
|
|
|
+ status='1',
|
|
|
|
|
+ black_list_num=black_list_num - 1
|
|
|
|
|
+ ,
|
|
|
|
|
+ credit_score=#{deducPoints}
|
|
|
|
|
+ WHERE user_id = #{userId}
|
|
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="delByUserId">
|
|
|
|
|
+ delete
|
|
|
|
|
+ from lab_violation
|
|
|
|
|
+ where join_user_id = #{userId}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="checkDeptId" resultType="integer">
|
|
|
|
|
+ select *
|
|
|
|
|
+ FROM sys_dept d
|
|
|
|
|
+ where d.dept_id = #{deptId}
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|