|
|
@@ -1,10 +1,11 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xunmei.core.resumption.mapper.ResumptionRecordMapper">
|
|
|
- <select id="selectListByCondition" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
|
|
|
+ <select id="selectListByCondition"
|
|
|
+ resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
|
|
|
select r.id as resumptionId,r.exception_count as abnormalDataNums,
|
|
|
- <!-- p.plan_name as time,
|
|
|
- p.plan_name as planName,-->
|
|
|
+ <!-- p.plan_name as time,
|
|
|
+ p.plan_name as planName,-->
|
|
|
r.plan_id as planId,
|
|
|
r.ymd_date as ymdDate,
|
|
|
r.status as status,
|
|
|
@@ -105,7 +106,8 @@
|
|
|
</where>
|
|
|
order by r.plan_start_time desc ,r.plan_end_time desc
|
|
|
</select>
|
|
|
- <select id="selectPageByCondition" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
|
|
|
+ <select id="selectPageByCondition"
|
|
|
+ resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo">
|
|
|
select r.id as resumptionId,r.exception_count as abnormalDataNums,
|
|
|
<!--p.plan_name as time,
|
|
|
p.plan_name as planName,-->
|
|
|
@@ -159,7 +161,7 @@
|
|
|
<if test="pageDto.executeCycle==4">
|
|
|
and r.ymd_year between #{hashMap.startYear} and #{hashMap.endYear}
|
|
|
and r.ymd_date between #{hashMap.startDate} and #{hashMap.endDate}
|
|
|
- <!-- and r.ymd_month between #{hashMap.startMonth} and #{hashMap.endMonth}-->
|
|
|
+ <!-- and r.ymd_month between #{hashMap.startMonth} and #{hashMap.endMonth}-->
|
|
|
and r.ymd_date between #{hashMap.startMonth} and #{hashMap.endMonth}
|
|
|
and r.ymd_quarter in
|
|
|
<foreach collection="ymdQuarters" item="item" index="index" open="(" separator="," close=")">
|
|
|
@@ -196,25 +198,27 @@
|
|
|
<if test="pageDto.orgId !=null ">
|
|
|
and r.org_id = #{pageDto.orgId}
|
|
|
</if>
|
|
|
+ <if test="pageDto.orgIdList!=null and pageDto.orgIdList.size()>0">
|
|
|
+ and r.org_id in
|
|
|
+ <foreach collection="pageDto.orgIdList" item="orgId" open="(" close=")" separator=",">
|
|
|
+ #{orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="pageDto.executeRole !=null ">
|
|
|
and r.role_id = #{pageDto.executeRole}
|
|
|
</if>
|
|
|
<if test="pageDto.planId !=null ">
|
|
|
and r.plan_id = #{pageDto.planId}
|
|
|
</if>
|
|
|
-<!-- <if test="pageDto.checkSub == true">-->
|
|
|
-<!-- and o.path like concat(#{pageDto.orgPath},'%')-->
|
|
|
-<!-- </if>-->
|
|
|
- <if test="pageDto.orgIdList!=null and pageDto.orgIdList.size()>0">
|
|
|
- and r.org_id in
|
|
|
- <foreach collection="pageDto.orgIdList" item="orgId" open="(" close=")" separator=",">
|
|
|
- #{orgId}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <!-- <if test="pageDto.checkSub == true">-->
|
|
|
+ <!-- and o.path like concat(#{pageDto.orgPath},'%')-->
|
|
|
+ <!-- </if>-->
|
|
|
+
|
|
|
</where>
|
|
|
order by r.plan_start_time desc ,r.plan_end_time desc
|
|
|
</select>
|
|
|
- <select id="selectResumptionDataList" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
|
|
|
+ <select id="selectResumptionDataList"
|
|
|
+ resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
|
|
|
select p.point_num as rulePointNum,
|
|
|
p.point_name as rulePointName,
|
|
|
p.safe_type as safeType,
|
|
|
@@ -235,7 +239,7 @@
|
|
|
<resultMap id="infoResultMap" type="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo">
|
|
|
<id column="id" jdbcType="BIGINT" javaType="java.lang.Long" property="itemId"/>
|
|
|
<result column="item_name" jdbcType="VARCHAR" javaType="java.lang.String" property="itemName"/>
|
|
|
-<!-- <result column="item_desc" jdbcType="VARCHAR" javaType="java.lang.String" property="itemDesc"/>-->
|
|
|
+ <!-- <result column="item_desc" jdbcType="VARCHAR" javaType="java.lang.String" property="itemDesc"/>-->
|
|
|
<collection property="dataInfoList"
|
|
|
ofType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo"
|
|
|
select="selectResumptionDataList"
|
|
|
@@ -281,35 +285,35 @@
|
|
|
where n.resumption_id = #{dto.resumptionId}
|
|
|
</select>
|
|
|
|
|
|
-<!-- <resultMap id="secMap" type="com.isp.dict.domain.SecBookDtInst">-->
|
|
|
-<!-- <id column="ID" jdbcType="BIGINT" javaType="java.lang.Long" property="id"/>-->
|
|
|
-<!-- <result column="DATA_NAME" jdbcType="VARCHAR" javaType="java.lang.String" property="dataName"/>-->
|
|
|
-<!-- <result column="DATA_TYPE" jdbcType="VARCHAR" javaType="java.lang.String" property="dataType"/>-->
|
|
|
-<!-- <result column="DELETE_STATUS" jdbcType="VARCHAR" javaType="java.lang.String" property="deleteStatus"/>-->
|
|
|
-<!-- <result column="IS_VALIE" jdbcType="VARCHAR" javaType="java.lang.String" property="isValie"/>-->
|
|
|
-<!-- <collection property="dataItemList" ofType="com.isp.dict.domain.SecBookDtiInst"-->
|
|
|
-<!-- select="selectSecBookDtiInstList"-->
|
|
|
-<!-- column="{secBookDtInstId=ID}">-->
|
|
|
-<!-- </collection>-->
|
|
|
-<!-- </resultMap>-->
|
|
|
+ <!-- <resultMap id="secMap" type="com.isp.dict.domain.SecBookDtInst">-->
|
|
|
+ <!-- <id column="ID" jdbcType="BIGINT" javaType="java.lang.Long" property="id"/>-->
|
|
|
+ <!-- <result column="DATA_NAME" jdbcType="VARCHAR" javaType="java.lang.String" property="dataName"/>-->
|
|
|
+ <!-- <result column="DATA_TYPE" jdbcType="VARCHAR" javaType="java.lang.String" property="dataType"/>-->
|
|
|
+ <!-- <result column="DELETE_STATUS" jdbcType="VARCHAR" javaType="java.lang.String" property="deleteStatus"/>-->
|
|
|
+ <!-- <result column="IS_VALIE" jdbcType="VARCHAR" javaType="java.lang.String" property="isValie"/>-->
|
|
|
+ <!-- <collection property="dataItemList" ofType="com.isp.dict.domain.SecBookDtiInst"-->
|
|
|
+ <!-- select="selectSecBookDtiInstList"-->
|
|
|
+ <!-- column="{secBookDtInstId=ID}">-->
|
|
|
+ <!-- </collection>-->
|
|
|
+ <!-- </resultMap>-->
|
|
|
|
|
|
-<!-- <select id="selectSecBookDtInstList" resultMap="secMap">-->
|
|
|
-<!-- select *-->
|
|
|
-<!-- from sec_book_dt_inst-->
|
|
|
-<!-- </select>-->
|
|
|
+ <!-- <select id="selectSecBookDtInstList" resultMap="secMap">-->
|
|
|
+ <!-- select *-->
|
|
|
+ <!-- from sec_book_dt_inst-->
|
|
|
+ <!-- </select>-->
|
|
|
|
|
|
-<!-- <select id="selectSecBookDtiInstList" resultType="com.isp.dict.domain.SecBookDtiInst">-->
|
|
|
-<!-- select ID as id,-->
|
|
|
-<!-- SEC_BOOK_DT_INST_ID as secBookDtInesId,-->
|
|
|
-<!-- DATA_ITEM_NUMB as dataItemNumb,-->
|
|
|
-<!-- DATA_ITEM_NAME as dataItemName,-->
|
|
|
-<!-- DATA_ITEM_VALUE as dataItemValue-->
|
|
|
-<!-- from sec_book_dti_inst-->
|
|
|
-<!-- where SEC_BOOK_DT_INST_ID = #{secBookDtInstId}-->
|
|
|
-<!-- </select>-->
|
|
|
+ <!-- <select id="selectSecBookDtiInstList" resultType="com.isp.dict.domain.SecBookDtiInst">-->
|
|
|
+ <!-- select ID as id,-->
|
|
|
+ <!-- SEC_BOOK_DT_INST_ID as secBookDtInesId,-->
|
|
|
+ <!-- DATA_ITEM_NUMB as dataItemNumb,-->
|
|
|
+ <!-- DATA_ITEM_NAME as dataItemName,-->
|
|
|
+ <!-- DATA_ITEM_VALUE as dataItemValue-->
|
|
|
+ <!-- from sec_book_dti_inst-->
|
|
|
+ <!-- where SEC_BOOK_DT_INST_ID = #{secBookDtInstId}-->
|
|
|
+ <!-- </select>-->
|
|
|
|
|
|
<select id="selectDataInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
|
|
|
- SELECT p.point_name AS pointName,
|
|
|
+ SELECT p.point_name AS pointName,
|
|
|
a.`name` AS areaName,
|
|
|
d.res_value AS executeResult,
|
|
|
d.submit_time AS executeTime,
|
|
|
@@ -318,7 +322,7 @@
|
|
|
d.id AS dataId,
|
|
|
p.data_type AS dataTypeId
|
|
|
FROM core_resumption_data d
|
|
|
- INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
|
|
|
+ INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
|
|
|
INNER JOIN sys_area a ON a.id = p.area_id
|
|
|
WHERE d.resumption_id = #{resumptionId}
|
|
|
and p.item_id = #{ruleItemId}
|
|
|
@@ -326,13 +330,12 @@
|
|
|
|
|
|
<select id="selectRuleItemIdList" resultType="java.lang.Long">
|
|
|
select DISTINCT p.item_id
|
|
|
- from core_resumption_rule_point p
|
|
|
+ from core_resumption_rule_point p
|
|
|
where id in (select d.item_id from core_resumption_data d where resumption_id = #{resumptionId})
|
|
|
-
|
|
|
</select>
|
|
|
<select id="selectRuleItemIdListByResumptionIdList" resultType="java.lang.Long">
|
|
|
select DISTINCT p.item_id
|
|
|
- from core_resumption_rule_point p
|
|
|
+ from core_resumption_rule_point p
|
|
|
where id in (select d.item_id from core_resumption_data d where resumption_id IN
|
|
|
<foreach collection="resumptionIdList" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
@@ -342,37 +345,37 @@
|
|
|
</select>
|
|
|
<select id="selectRuleItemInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo">
|
|
|
select i.item_num as itemNum, i.item_name as itemName, i.item_desc as itemDesc, i.id as itemId
|
|
|
- from core_resumption_rule_item i
|
|
|
+ from core_resumption_rule_item i
|
|
|
where id = #{ruleItemId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">
|
|
|
- select distinct p.id as id, p.plan_name as name, p.plan_status as status
|
|
|
- from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0
|
|
|
- inner join core_resumption_plan_to_role pr on p.id = pr.plan_id
|
|
|
- INNER JOIN sys_org o on o.id=r.org_id
|
|
|
- where o.path like concat(#{planDto.orgPath},'%')
|
|
|
- <choose>
|
|
|
- <when test="planDto.type != null and planDto.type ==0">
|
|
|
- and r.type in (0,6)
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and r.type = #{planDto.type}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- <if test="planDto.roleId != null">
|
|
|
- and pr.role_id = #{planDto.roleId}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
-<!-- <select id="selectData" resultType="com.xunmei.core.resumption.vo.registerBook.RegisterBookItemInfoVo">-->
|
|
|
-<!-- select distinct o.name as orgName, r.start_time as date, #{id} as resumptionId-->
|
|
|
-<!-- from core_resumption r-->
|
|
|
-<!-- inner join sys_org o on r.org_id = o.id-->
|
|
|
-<!-- inner join core_resumption_data d on r.id = d.resumption_id-->
|
|
|
-<!-- where d.resumption_id = #{id}-->
|
|
|
+<!-- <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
|
|
|
+<!-- select distinct p.id as id, p.plan_name as name, p.plan_status as status-->
|
|
|
+<!-- from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0-->
|
|
|
+<!-- inner join core_resumption_plan_to_role pr on p.id = pr.plan_id-->
|
|
|
+<!-- INNER JOIN sys_org o on o.id=r.org_id-->
|
|
|
+<!-- where o.path like concat(#{planDto.orgPath},'%')-->
|
|
|
+<!-- <choose>-->
|
|
|
+<!-- <when test="planDto.type != null and planDto.type ==0">-->
|
|
|
+<!-- and r.type in (0,6)-->
|
|
|
+<!-- </when>-->
|
|
|
+<!-- <otherwise>-->
|
|
|
+<!-- and r.type = #{planDto.type}-->
|
|
|
+<!-- </otherwise>-->
|
|
|
+<!-- </choose>-->
|
|
|
+<!-- <if test="planDto.roleId != null">-->
|
|
|
+<!-- and pr.role_id = #{planDto.roleId}-->
|
|
|
+<!-- </if>-->
|
|
|
<!-- </select>-->
|
|
|
|
|
|
+ <!-- <select id="selectData" resultType="com.xunmei.core.resumption.vo.registerBook.RegisterBookItemInfoVo">-->
|
|
|
+ <!-- select distinct o.name as orgName, r.start_time as date, #{id} as resumptionId-->
|
|
|
+ <!-- from core_resumption r-->
|
|
|
+ <!-- inner join sys_org o on r.org_id = o.id-->
|
|
|
+ <!-- inner join core_resumption_data d on r.id = d.resumption_id-->
|
|
|
+ <!-- where d.resumption_id = #{id}-->
|
|
|
+ <!-- </select>-->
|
|
|
+
|
|
|
<select id="selectResumptionDataPointId" resultType="java.lang.Long">
|
|
|
select item_id
|
|
|
from core_resumption_data
|
|
|
@@ -382,7 +385,7 @@
|
|
|
<select id="selectAbnormalData" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordTempVo">
|
|
|
SELECT d.resumption_id as resumptionId,count(d.res_value = '1' or null) as nums,count(d.id) as nums2
|
|
|
FROM core_resumption_data d
|
|
|
- INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
|
|
|
+ INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
|
|
|
where d.resumption_id in
|
|
|
<foreach collection="resumptionIdList" item="resumptionId" open="(" separator="," close=")">
|
|
|
#{resumptionId}
|
|
|
@@ -394,11 +397,13 @@
|
|
|
GROUP BY d.resumption_id
|
|
|
</select>
|
|
|
<select id="selectItemIdList" resultType="java.lang.Long">
|
|
|
- select d.item_id from core_resumption_data d where resumption_id = #{resumptionId}
|
|
|
+ select d.item_id
|
|
|
+ from core_resumption_data d
|
|
|
+ where resumption_id = #{resumptionId}
|
|
|
</select>
|
|
|
<select id="selectRuleItemIdListNew" resultType="java.lang.Long">
|
|
|
select DISTINCT p.item_id
|
|
|
- from core_resumption_rule_point p
|
|
|
+ from core_resumption_rule_point p
|
|
|
where id in
|
|
|
<foreach collection="ruleItemIdList" item="rulePointId" open="(" separator="," close=")">
|
|
|
#{rulePointId}
|
|
|
@@ -406,14 +411,45 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectResumptionRoles" resultType="com.xunmei.common.core.vo.IdNameVo">
|
|
|
- select distinctrow r.id,r.name
|
|
|
+ select distinctrow r.id,r.role_name as name
|
|
|
from core_resumption_plan p
|
|
|
inner join core_resumption_plan_to_role pr on p.id=pr.plan_id
|
|
|
inner join sys_role r on pr.role_id=r.id
|
|
|
- where p.plan_status = 0
|
|
|
-<!-- <if test="roleDto.type != null">-->
|
|
|
-<!-- and plan_cycle=#{roleDto.type}-->
|
|
|
-<!-- </if>-->
|
|
|
-
|
|
|
+ where p.plan_status = 0 and plan_create_org_id=plan_of_org_id
|
|
|
+ <if test="query.planCycle != null">
|
|
|
+ and plan_cycle = #{query.planCycle}
|
|
|
+ </if>
|
|
|
+ <if test="query.planId != null">
|
|
|
+ and id = #{query.planId}
|
|
|
+ </if>
|
|
|
+ <if test="query.upOrgIds!=null and query.upOrgIds.size>0">
|
|
|
+ and (p.plan_create_org_id in
|
|
|
+ <foreach collection="query.upOrgIds" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ or p.plan_create_org_id in (select id from sys_org
|
|
|
+ where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectResumptionPlan" resultType="com.xunmei.common.core.vo.IdNameVo">
|
|
|
+ select id, plan_name as name
|
|
|
+ from core_resumption_plan
|
|
|
+ where plan_status = 0 and plan_create_org_id=plan_of_org_id
|
|
|
+ <if test="query.planCycle != null">
|
|
|
+ and plan_cycle = #{query.planCycle}
|
|
|
+ </if>
|
|
|
+ <if test="query.planId != null">
|
|
|
+ and id = #{query.planId}
|
|
|
+ </if>
|
|
|
+ <if test="query.upOrgIds!=null and query.upOrgIds.size>0">
|
|
|
+ and (p.plan_create_org_id in
|
|
|
+ <foreach collection="query.upOrgIds" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ or p.plan_create_org_id in (select id from sys_org
|
|
|
+ where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|