|
@@ -1,1228 +0,0 @@
|
|
|
-<?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.rtrh.projects.modules.projects.mapper.SubInfoMapper" >
|
|
|
- <insert id="batchInsertSubFix">
|
|
|
- INSERT INTO sub_fix (id, sub_id, year, cat, create_time, create_user_id)
|
|
|
- VALUES
|
|
|
- <foreach collection="subFixList" item="item" separator=",">
|
|
|
- (#{item.id}, #{item.subId}, #{item.year}, #{item.cat}, #{item.createTime}, #{item.createUserId})
|
|
|
- </foreach>
|
|
|
- </insert>
|
|
|
-
|
|
|
-
|
|
|
- <select id="smartSiteQuery" resultType="com.rtrh.projects.modules.projects.vo.SubSmartVO" >
|
|
|
- SELECT
|
|
|
- si.sub_name subName,
|
|
|
- si.begin_date beginDate,
|
|
|
- si.end_date endDate,
|
|
|
- si.amt_total amtTotal,
|
|
|
- si.amt_year amtYear,
|
|
|
- src2.yearAmtSj,
|
|
|
- si.name_zrr nameZrr,
|
|
|
- si.name_lead nameLead,
|
|
|
- si.abc,
|
|
|
- si.status,
|
|
|
- si.longitude,
|
|
|
- si.latitude,
|
|
|
- si.id,
|
|
|
- (
|
|
|
- SELECT
|
|
|
- num_bl
|
|
|
- FROM
|
|
|
- sub_rpt_cont src
|
|
|
- WHERE
|
|
|
- src.sub_id = si.id
|
|
|
- AND src.logic_delete_flag = 0
|
|
|
- ORDER BY
|
|
|
- last_update_time DESC,
|
|
|
- create_time DESC
|
|
|
- LIMIT 1
|
|
|
- ) numBl
|
|
|
- FROM
|
|
|
- -- sub_camera sc
|
|
|
- -- LEFT JOIN sub_info si ON sc.sub_id = si.id
|
|
|
- sub_info si
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- sum(amt) yearAmt,
|
|
|
- sa.sub_id
|
|
|
- FROM
|
|
|
- sub_amtplan sa
|
|
|
- WHERE
|
|
|
- sa.logic_delete_flag = 0
|
|
|
- AND sa.y_month LIKE CONCAT('',#{year},'%')
|
|
|
- GROUP BY
|
|
|
- sa.sub_id
|
|
|
- ) sa ON sa.sub_id = si.id
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- sum(amt) yearAmtSj,
|
|
|
- src.sub_id
|
|
|
- FROM
|
|
|
- sub_rpt_cont src
|
|
|
- WHERE
|
|
|
- src.logic_delete_flag = 0
|
|
|
- AND src.kj_month LIKE CONCAT('',#{year},'%')
|
|
|
- GROUP BY
|
|
|
- src.sub_id
|
|
|
- ) src2 ON src2.sub_id = si.id
|
|
|
- WHERE
|
|
|
- -- sc.logic_delete_flag = 0
|
|
|
- si.logic_delete_flag = 0
|
|
|
- and si.indus_kind in('210','99','2')
|
|
|
- AND si.longitude is not null
|
|
|
- AND si.latitude is not null
|
|
|
- AND si.subject_id in
|
|
|
- <foreach item="item" collection="subjectIds" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- GROUP BY
|
|
|
- si.id
|
|
|
- </select>
|
|
|
-
|
|
|
-<!-- <resultMap id="BaseResultMap" type="com.rtrh.projects.modules.projects.po.SubInfoGxj">
|
|
|
- <id column="id" property="id" />
|
|
|
- <result column="sub_id" property="subId" />
|
|
|
- <result column="unit_id" property="unitId" />
|
|
|
- <result column="unit_desc" property="unitDesc" />
|
|
|
- <result column="sub_code" property="subCode" />
|
|
|
- <result column="sub_name" property="subName" />
|
|
|
- <result column="indus_kind" property="indusKind" />
|
|
|
- <result column="amt_total" property="amtTotal" />
|
|
|
- <result column="abc" property="abc" />
|
|
|
- <result column="subject_id" property="subjectId" />
|
|
|
- <result column="begin_date" property="beginDate" />
|
|
|
- <result column="end_date" property="endDate" />
|
|
|
- <result column="rt_date" property="rtDate" />
|
|
|
- <result column="content" property="content" />
|
|
|
- <result column="progress" property="progress" />
|
|
|
- <result column="cb_status" property="cbStatus" />
|
|
|
- <result column="qy_date" property="qyDate" />
|
|
|
- <result column="xj_date" property="xjDate" />
|
|
|
- <result column="zj_date" property="zjDate" />
|
|
|
- <result column="tc_date" property="tcDate" />
|
|
|
- <result column="cb_num" property="cbNum" />
|
|
|
- <result column="xj_num" property="xjNum" />
|
|
|
- <result column="zj_num" property="zjNum" />
|
|
|
- <result column="remark" property="remark" />
|
|
|
- <result column="name_zrr" property="nameZrr" />
|
|
|
- <result column="tel" property="tel" />
|
|
|
- <result column="name_lead" property="nameLead" />
|
|
|
- <result column="tel_lead" property="telLead" />
|
|
|
- <result column="status" property="status" />
|
|
|
- <result column="is_rg" property="isRg" />
|
|
|
- <result column="rg_date" property="rgDate" />
|
|
|
- <result column="create_user_id" property="createUserId" />
|
|
|
- <result column="create_user_name" property="createUserName" />
|
|
|
- <result column="create_time" property="createTime" />
|
|
|
- <result column="last_update_user_id" property="lastUpdateUserId" />
|
|
|
- <result column="last_update_user_name" property="lastUpdateUserName" />
|
|
|
- <result column="last_update_time" property="lastUpdateTime" />
|
|
|
- <result column="logic_delete_flag" property="logicDeleteFlag" />
|
|
|
- <result column="status_lamp" property="statusLamp" />
|
|
|
- <result column="kind_nature" property="kindNature" />
|
|
|
- </resultMap>-->
|
|
|
-
|
|
|
- <select id="queryPage" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
|
|
|
- SELECT
|
|
|
- s.id,
|
|
|
- s.sub_id AS subId,
|
|
|
- s.unit_id AS unitId,
|
|
|
- s.unit_desc AS unitDesc,
|
|
|
- s.sub_code AS subCode,
|
|
|
- s.sub_name AS subName,
|
|
|
- s.indus_kind AS indusKind,
|
|
|
- s.amt_total AS amtTotal,
|
|
|
- s.abc,
|
|
|
- s.subject_id AS subjectId,
|
|
|
- s.begin_date AS beginDate,
|
|
|
- s.end_date AS endDate,
|
|
|
- s.rt_date AS rtDate,
|
|
|
- s.content AS content,
|
|
|
- s.progress AS progress,
|
|
|
- s.cb_status AS cbStatus,
|
|
|
- s.qy_date AS qyDate,
|
|
|
- s.xj_date AS xjDate,
|
|
|
- s.zj_date AS zjDate,
|
|
|
- s.tc_date AS tcDate,
|
|
|
- s.cb_num AS cbNum,
|
|
|
- s.xj_num AS xjNum,
|
|
|
- s.zj_num AS zjNum,
|
|
|
- s.remark,
|
|
|
- s.name_zrr AS nameZrr,
|
|
|
- s.tel AS tel,
|
|
|
- s.name_lead AS nameLead,
|
|
|
- s.tel_lead AS telLead,
|
|
|
- s.status AS status,
|
|
|
- s.is_rg AS boolRg,
|
|
|
- s.rg_date AS rgDate,
|
|
|
- s.create_user_id AS createUserId,
|
|
|
- s.create_user_name AS createUserName,
|
|
|
- s.create_time AS createTime,
|
|
|
- s.last_update_user_id AS lastUpdateUserId,
|
|
|
- s.last_update_user_name AS lastUpdateUserName,
|
|
|
- s.last_update_time AS lastUpdateTime,
|
|
|
- s.logic_delete_flag AS logicDeleteFlag,
|
|
|
- s.status_lamp AS statusLamp,
|
|
|
- s.kind_nature AS kindNature
|
|
|
- <if test="vo.status!=null and vo.status==3 and vo.month!=null and vo.month!=''">
|
|
|
- ,src.yearPlanAmt
|
|
|
- </if>
|
|
|
- from sub_info s
|
|
|
- <if test="vo.status!=null and vo.status==3 and vo.month!=null and vo.month!=''">
|
|
|
- LEFT JOIN
|
|
|
- (SELECT SUM(amt) yearPlanAmt,sub_id FROM sub_amtplan WHERE y_month RLIKE #{vo.month} AND NOT ISNULL(amt) GROUP BY sub_id) src
|
|
|
- ON s.id=src.sub_id
|
|
|
- </if>
|
|
|
- <where>
|
|
|
- s.logic_delete_flag = 0
|
|
|
- <if test="vo.subName!=null and vo.subName!=''">
|
|
|
- and s.sub_name like CONCAT('%', #{vo.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="vo.kindNature!=null and vo.kindNature!=''">
|
|
|
- and s.kind_nature = #{vo.kindNature}
|
|
|
- </if>
|
|
|
- <if test="vo.subjects!=null and vo.subjects!=''">
|
|
|
- and s.subject_id = #{vo.subjects}
|
|
|
- </if>
|
|
|
- <if test="vo.subjectId!=null and vo.subjectId!=''">
|
|
|
- and s.subject_id = #{vo.subjectId}
|
|
|
- </if>
|
|
|
- <if test="vo.subjectAuthIds!=null and vo.subjectAuthIds.size()>0">
|
|
|
- and s.subject_id in
|
|
|
- <foreach collection="vo.subjectAuthIds" item="id" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="vo.indusKind!=null and vo.indusKind!=''">
|
|
|
- <if test='vo.indusKind != "UNKNOWN_INDUS_KIND"'>
|
|
|
- and s.indus_kind like CONCAT(#{vo.indusKind}, '%')
|
|
|
- </if>
|
|
|
- <if test='vo.indusKind.toString() == "UNKNOWN_INDUS_KIND"'>
|
|
|
- AND ISNULL(s.indus_kind)
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test="vo.startAmt!=null and vo.startAmt!=''">
|
|
|
- and s.amt_total >= #{vo.startAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.endAmt!=null and vo.endAmt!=''">
|
|
|
- and s.amt_total <= #{vo.endAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.sbdw!=null and vo.sbdw!=''">
|
|
|
- and s.unit_desc = #{vo.sbdw}
|
|
|
- </if>
|
|
|
- <if test="vo.abc!=null and vo.abc!=''">
|
|
|
- <choose>
|
|
|
- <when test='vo.abc.toString() =="UNKNOWN_CATEGORY"'>
|
|
|
- and s.abc is null
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and s.abc = #{vo.abc}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="vo.status!=null and vo.status!=''">
|
|
|
- and s.status = #{vo.status}
|
|
|
- <if test="vo.status==3">
|
|
|
- <if test="vo.yearMixAmt!=null and vo.yearMixAmt!=''">
|
|
|
- and src.yearPlanAmt >=#{vo.yearMixAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.yearMaxAmt!=null and vo.yearMaxAmt!=''">
|
|
|
- and src.yearPlanAmt <=#{vo.yearMaxAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.beginDate!=null and vo.beginDate!=''">
|
|
|
- and s.end_date >= #{vo.beginDate}
|
|
|
- </if>
|
|
|
- <if test="vo.endDate!=null and vo.endDate!=''">
|
|
|
- and s.end_date <= #{vo.endDate}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test='vo.status==2'>
|
|
|
- <if test="vo.beginDate!=null and vo.beginDate!=''">
|
|
|
- and s.begin_date >= #{vo.beginDate}
|
|
|
- </if>
|
|
|
- <if test="vo.endDate!=null and vo.endDate!=''">
|
|
|
- and s.begin_date <= #{vo.endDate}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- <if test='vo.status==9'>
|
|
|
- <if test="vo.beginDate!=null and vo.beginDate!=''">
|
|
|
- and s.rt_date >= #{vo.beginDate}
|
|
|
- </if>
|
|
|
- <if test="vo.endDate!=null and vo.endDate!=''">
|
|
|
- and s.rt_date <= #{vo.endDate}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
- <select id="queryStatistics" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
|
|
|
- select
|
|
|
- status,abc,subject_id subjectId,indus_kind indusKind,is_rg AS boolRg
|
|
|
- from sub_info
|
|
|
- <where>
|
|
|
- logic_delete_flag = 0
|
|
|
- <if test="vo.subName!=null and vo.subName!=''">
|
|
|
- and sub_name like CONCAT('%', #{vo.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="vo.subjectId!=null and vo.subjectId!=''">
|
|
|
- and subject_id = #{vo.subjectId}
|
|
|
- </if>
|
|
|
- <if test="vo.startAmt!=null and vo.startAmt!=''">
|
|
|
- and amt_total >= #{vo.startAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.endAmt!=null and vo.endAmt!=''">
|
|
|
- and amt_total <= #{vo.endAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.sbdw!=null and vo.sbdw!=''">
|
|
|
- and unit_desc = #{vo.sbdw}
|
|
|
- </if>
|
|
|
- <if test="vo.status!=null and vo.status!=''">
|
|
|
- and status = #{vo.status}
|
|
|
- </if>
|
|
|
- <if test="vo.subjectAuthIds!=null and vo.subjectAuthIds.size()>0">
|
|
|
- and subject_id in
|
|
|
- <foreach collection="vo.subjectAuthIds" item="id" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="vo.abc!=null and vo.abc!=''">
|
|
|
- <choose>
|
|
|
- <when test='vo.abc.toString() =="UNKNOWN_CATEGORY"'>
|
|
|
- and abc is null
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and abc = #{vo.abc}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="vo.indusKind!=null and vo.indusKind!=''">
|
|
|
- <choose>
|
|
|
- <when test='vo.indusKind.toString() == "UNKNOWN_INDUS_KIND"'>
|
|
|
- AND ISNULL(indus_kind)
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and indus_kind like CONCAT(#{vo.indusKind}, '%')
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
- <select id="findById" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
|
|
|
- SELECT
|
|
|
- id,
|
|
|
- sub_id AS subId,
|
|
|
- unit_id AS unitId,
|
|
|
- unit_desc AS unitDesc,
|
|
|
- sub_code AS subCode,
|
|
|
- sub_name AS subName,
|
|
|
- indus_kind AS indusKind,
|
|
|
- amt_total AS amtTotal,
|
|
|
- abc,
|
|
|
- subject_id AS subjectId,
|
|
|
- begin_date AS beginDate,
|
|
|
- end_date AS endDate,
|
|
|
- rt_date AS rtDate,
|
|
|
- content AS content,
|
|
|
- progress AS progress,
|
|
|
- cb_status AS cbStatus,
|
|
|
- qy_date AS qyDate,
|
|
|
- xj_date AS xjDate,
|
|
|
- zj_date AS zjDate,
|
|
|
- tc_date AS tcDate,
|
|
|
- cb_num AS cbNum,
|
|
|
- xj_num AS xjNum,
|
|
|
- zj_num AS zjNum,
|
|
|
- remark,
|
|
|
- name_zrr AS nameZrr,
|
|
|
- tel AS tel,
|
|
|
- name_lead AS nameLead,
|
|
|
- tel_lead AS telLead,
|
|
|
- status AS status,
|
|
|
- is_rg AS isRg,
|
|
|
- rg_date AS rgDate,
|
|
|
- create_user_id AS createUserId,
|
|
|
- create_user_name AS createUserName,
|
|
|
- create_time AS createTime,
|
|
|
- last_update_user_id AS lastUpdateUserId,
|
|
|
- last_update_user_name AS lastUpdateUserName,
|
|
|
- last_update_time AS lastUpdateTime,
|
|
|
- status_lamp AS statusLamp,
|
|
|
- kind_nature AS kindNature
|
|
|
- from sub_info
|
|
|
- where id = #{id}
|
|
|
- </select>
|
|
|
- <select id="findByFgwId" resultType="com.rtrh.projects.modules.projects.po.SubInfo">
|
|
|
- SELECT
|
|
|
- id,
|
|
|
- unit_id AS unitId,
|
|
|
- unit_desc AS unitDesc,
|
|
|
- sub_code AS subCode,
|
|
|
- sub_name AS subName,
|
|
|
- indus_kind AS indusKind,
|
|
|
- amt_total AS amtTotal,
|
|
|
- abc,
|
|
|
- subject_id AS subjectId,
|
|
|
- begin_date AS beginDate,
|
|
|
- end_date AS endDate,
|
|
|
- rt_date AS rtDate,
|
|
|
- content AS content,
|
|
|
- progress AS progress,
|
|
|
- cb_status AS cbStatus,
|
|
|
- qy_date AS qyDate,
|
|
|
- xj_date AS xjDate,
|
|
|
- zj_date AS zjDate,
|
|
|
- tc_date AS tcDate,
|
|
|
- cb_num AS cbNum,
|
|
|
- xj_num AS xjNum,
|
|
|
- zj_num AS zjNum,
|
|
|
- remark,
|
|
|
- name_zrr AS nameZrr,
|
|
|
- tel AS tel,
|
|
|
- name_lead AS nameLead,
|
|
|
- tel_lead AS telLead,
|
|
|
- status AS status,
|
|
|
- rg_date AS rgDate,
|
|
|
- create_user_id AS createUserId,
|
|
|
- create_user_name AS createUserName,
|
|
|
- create_time AS createTime,
|
|
|
- last_update_user_id AS lastUpdateUserId,
|
|
|
- last_update_user_name AS lastUpdateUserName,
|
|
|
- last_update_time AS lastUpdateTime,
|
|
|
- logic_delete_flag AS logicDeleteFlag,
|
|
|
- status_lamp AS statusLamp,
|
|
|
- kind_nature AS kindNature
|
|
|
- from sub_info
|
|
|
- where id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="subFixCbAll" resultType="com.rtrh.projects.modules.projects.vo.SubFixCbVo">
|
|
|
- SELECT sub_info.id as id,
|
|
|
- sub_info.sub_name as subName,
|
|
|
- sub_info.subject_id as subjectId,
|
|
|
- sub_info.content as content,
|
|
|
- sub_info.amt_total as amtTotal,
|
|
|
- sub_info.progress as progress,
|
|
|
- sub_info.remark as remark
|
|
|
- FROM sub_fix
|
|
|
- LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE sub_fix.status = 1
|
|
|
- AND sub_info.logic_delete_flag = 0
|
|
|
- <if test="subFixCbSearch.year != null and subFixCbSearch.year != ''">
|
|
|
- AND sub_fix.year = #{subFixCbSearch.year}
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.subName != null and subFixCbSearch.subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subFixCbSearch.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.subjectId != null and subFixCbSearch.subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subFixCbSearch.subjectId}
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.indusKind != null and subFixCbSearch.indusKind != ''">
|
|
|
- AND sub_info.indus_kind = #{subFixCbSearch.indusKind}
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.startAmt != null">
|
|
|
- AND sub_info.amt_total >= #{subFixCbSearch.startAmt}
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.endAmt != null">
|
|
|
- AND sub_info.amt_total <= #{subFixCbSearch.endAmt}
|
|
|
- </if>
|
|
|
- <if test="subFixCbSearch.sbdw != null and subFixCbSearch.sbdw != ''">
|
|
|
- AND sub_info.sbdw LIKE CONCAT('%', #{subFixCbSearch.sbdw}, '%')
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectAllSubInfoIdsNotSubFix" resultType="java.lang.String">
|
|
|
- SELECT id
|
|
|
- FROM sub_info
|
|
|
- <where>
|
|
|
- <if test="subIdList != null and subIdList.size > 0">
|
|
|
- id NOT IN
|
|
|
- <foreach collection="subIdList" item="id" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND status = #{status}
|
|
|
- </if>
|
|
|
- AND amt_total >= 10000
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getFixTotalExcel" resultType="com.rtrh.projects.modules.projects.vo.SubInfoTotalExcel">
|
|
|
- SELECT sub_info.subject_id as subjectId,
|
|
|
- sub_info.sub_name as subName,
|
|
|
- sub_info.amt_total as amtTotal,
|
|
|
- sub_info.indus_kind as induskind
|
|
|
- FROM sub_fix
|
|
|
- LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE sub_fix.cat = #{stateFix} and sub_fix.year = #{year} and sub_info.logic_delete_flag = 0
|
|
|
- <if test="subName != null and subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subjectId != null and subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sbdw != null and sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="startAmt != null and startAmt !=''">
|
|
|
- AND sub_info.amt_total >= #{startAmt}
|
|
|
- </if>
|
|
|
- <if test="endAmt != null and endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="exportTotalExcelByStatus" resultType="com.rtrh.projects.modules.projects.vo.SubInfoTotalExcel">
|
|
|
- SELECT sub_info.subject_id as subjectId,
|
|
|
- sub_info.sub_name as subName,
|
|
|
- sub_info.amt_total as amtTotal,
|
|
|
- sub_info.indus_kind as indusKind,
|
|
|
- sub_info.status as status
|
|
|
- from sub_info
|
|
|
- <where>
|
|
|
- sub_info.logic_delete_flag = 0
|
|
|
- <if test="vo.status != null and vo.status != ''">
|
|
|
- and sub_info.status = #{vo.status}
|
|
|
- </if>
|
|
|
- <if test="vo.subName!=null and vo.subName!=''">
|
|
|
- and sub_info.sub_name like CONCAT('%', #{vo.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="vo.subjectId!=null and vo.subjectId!=''">
|
|
|
- and sub_info.subject_id = #{vo.subjectId}
|
|
|
- </if>
|
|
|
- <if test="vo.startAmt!=null and vo.startAmt!=''">
|
|
|
- and sub_info.amt_total >= #{vo.startAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.endAmt!=null and vo.endAmt!=''">
|
|
|
- and sub_info.amt_total <= #{vo.endAmt}
|
|
|
- </if>
|
|
|
- <if test="vo.sbdw!=null and vo.sbdw!=''">
|
|
|
- and sub_info.unit_desc = #{vo.sbdw}
|
|
|
- </if>
|
|
|
- <if test="vo.subjectAuthIds!=null and vo.subjectAuthIds.size()>0">
|
|
|
- and sub_info.subject_id in
|
|
|
- <foreach collection="vo.subjectAuthIds" item="id" open="(" close=")" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="vo.abc!=null and vo.abc!=''">
|
|
|
- <choose>
|
|
|
- <when test='vo.abc.toString() =="UNKNOWN_CATEGORY"'>
|
|
|
- and sub_info.abc is null
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and sub_info.abc = #{vo.abc}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="vo.indusKind!=null and vo.indusKind!=''">
|
|
|
- <choose>
|
|
|
- <when test='vo.indusKind.toString() == "UNKNOWN_INDUS_KIND"'>
|
|
|
- AND ISNULL(sub_info.indus_kind)
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- and sub_info.indus_kind like CONCAT(#{vo.indusKind}, '%')
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="exportFixDetailExcel" resultType="com.rtrh.projects.modules.projects.vo.export.SubInfoFixDetail">
|
|
|
- SELECT sub_info.id as id,
|
|
|
- sub_info.sub_name as subName,
|
|
|
- sub_info.subject_id as subjectId,
|
|
|
- sub_info.content as content,
|
|
|
- sub_info.begin_date as beginDate,
|
|
|
- sub_info.amt_total as amtTotal,
|
|
|
- sub_info.remark as remark,
|
|
|
- sub_info.indus_kind as indusKind
|
|
|
- FROM sub_fix
|
|
|
- LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE sub_fix.cat = #{stateFix} and sub_fix.year = #{year} and sub_info.logic_delete_flag = 0
|
|
|
- <if test="subName != null and subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subjectId != null and subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sbdw != null and sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="startAmt != null and startAmt !=''">
|
|
|
- AND sub_info.amt_total >= #{startAmt}
|
|
|
- </if>
|
|
|
- <if test="endAmt != null and endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectSubPreNewBySubIds" resultType="com.rtrh.projects.modules.projects.vo.SubInfoFixDetailPreNew">
|
|
|
- SELECT
|
|
|
- a.sub_id as subId,
|
|
|
- a.status_conf as statusConf,
|
|
|
- b.title as title
|
|
|
- FROM
|
|
|
- sub_pre_new a
|
|
|
- LEFT JOIN
|
|
|
- sub_pre_flow b ON a.pre_flow_id = b.id
|
|
|
- WHERE
|
|
|
- a.sub_id IN
|
|
|
- <foreach collection="subIdList" item="subId" open="(" separator="," close=")">
|
|
|
- #{subId}
|
|
|
- </foreach>
|
|
|
- AND a.status = 1
|
|
|
- AND a.status_conf IN (1, 2);
|
|
|
- </select>
|
|
|
- <select id="selectNewestMonthReport" resultType="com.rtrh.projects.modules.projects.po.RptCont">
|
|
|
- SELECT
|
|
|
- DISTINCT
|
|
|
- src.sub_id AS subId,src.content
|
|
|
- FROM
|
|
|
- sub_rpt_cont src
|
|
|
- JOIN (
|
|
|
- SELECT
|
|
|
- sub_id,
|
|
|
- MAX(kj_month) AS latest_kj_month
|
|
|
- FROM
|
|
|
- sub_rpt_cont
|
|
|
- WHERE
|
|
|
- logic_delete_flag = 0
|
|
|
- AND sub_id IN
|
|
|
- <foreach collection="ids" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- AND kind = '1'
|
|
|
- AND content IS NOT NULL
|
|
|
- GROUP BY
|
|
|
- sub_id
|
|
|
- ) AS latest_src ON src.sub_id = latest_src.sub_id
|
|
|
- AND src.kj_month = latest_src.latest_kj_month
|
|
|
- WHERE
|
|
|
- src.logic_delete_flag = 0
|
|
|
- AND src.kind = '1'
|
|
|
- AND src.content IS NOT NULL
|
|
|
- </select>
|
|
|
- <select id="exportFixCbDetailExcel" resultType="com.rtrh.projects.modules.projects.vo.export.SubInfoFixCbDetail">
|
|
|
- SELECT sub_info.id as id,
|
|
|
- sub_info.sub_name as subName,
|
|
|
- sub_info.subject_id as subjectId,
|
|
|
- sub_info.content as content,
|
|
|
- sub_info.amt_total as amtTotal,
|
|
|
- sub_info.remark as remark,
|
|
|
- sub_info.indus_kind as indusKind,
|
|
|
- sub_info.progress as progress
|
|
|
- FROM sub_fix
|
|
|
- LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE sub_fix.cat = #{stateFix} and sub_fix.year = #{year} and sub_info.logic_delete_flag = 0
|
|
|
- <if test="subName != null and subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subjectId != null and subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sbdw != null and sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="startAmt != null and startAmt !=''">
|
|
|
- AND sub_info.amt_total >= #{startAmt}
|
|
|
- </if>
|
|
|
- <if test="endAmt != null and endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="exportFixZjDetailExcel" resultType="com.rtrh.projects.modules.projects.vo.export.SubInfoFixZjDetail">
|
|
|
- SELECT
|
|
|
- sub_info.id AS id,
|
|
|
- sub_info.sub_name AS subName,
|
|
|
- sub_info.subject_id AS subjectId,
|
|
|
- sub_info.content AS content,
|
|
|
- sub_info.amt_total AS amtTotal,
|
|
|
- sub_info.end_date AS endDate,
|
|
|
- sub_info.remark AS remark,
|
|
|
- sub_info.indus_kind AS indusKind,
|
|
|
- sub_info.progress AS progress
|
|
|
- FROM
|
|
|
- sub_fix
|
|
|
- LEFT JOIN
|
|
|
- sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE
|
|
|
- sub_info.logic_delete_flag = 0
|
|
|
- AND sub_fix.cat = #{stateFix}
|
|
|
- AND sub_fix.year = #{year}
|
|
|
- <if test="subName != null and subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subjectId != null and subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sbdw != null and sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="startAmt != null and startAmt !=''">
|
|
|
- AND sub_info.amt_total >= #{startAmt}
|
|
|
- </if>
|
|
|
- <if test="endAmt != null and endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectYearMoney" resultType="com.rtrh.projects.modules.projects.vo.export.MoneyMap">
|
|
|
- SELECT
|
|
|
- sub_id AS subId,
|
|
|
- SUM(amt) AS amt
|
|
|
- FROM
|
|
|
- sub_amtplan
|
|
|
- WHERE
|
|
|
- sub_id IN
|
|
|
- <foreach collection="subIdList" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- AND y_month LIKE CONCAT(#{year}, '%')
|
|
|
- AND logic_delete_flag = 0
|
|
|
- GROUP BY
|
|
|
- sub_id
|
|
|
- </select>
|
|
|
- <select id="exportFixTcDetailExcel" resultType="com.rtrh.projects.modules.projects.vo.export.SubInfoFixTcDetail">
|
|
|
- SELECT
|
|
|
- sub_info.id AS id,
|
|
|
- sub_info.sub_name AS subName,
|
|
|
- sub_info.subject_id AS subjectId,
|
|
|
- sub_info.content AS content,
|
|
|
- sub_info.rg_date AS rgDate,
|
|
|
- sub_info.remark AS remark,
|
|
|
- sub_info.indus_kind AS indusKind,
|
|
|
- sub_info.progress AS progress
|
|
|
- FROM
|
|
|
- sub_fix
|
|
|
- LEFT JOIN
|
|
|
- sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE
|
|
|
- sub_info.logic_delete_flag = 0
|
|
|
- AND sub_fix.cat = #{stateFix}
|
|
|
- AND sub_fix.year = #{year}
|
|
|
- <if test="subName != null and subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="subjectId != null and subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sbdw != null and sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="startAmt != null and startAmt !=''">
|
|
|
- AND sub_info.amt_total >= #{startAmt}
|
|
|
- </if>
|
|
|
- <if test="endAmt != null and endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="subFixGetBeginRate" resultType="com.rtrh.projects.vo.projects.SubFixGetBeginRateVo">
|
|
|
- SELECT
|
|
|
- sub_info.id AS id,
|
|
|
- sub_info.status AS status,
|
|
|
- sub_info.subject_id AS subjectId,
|
|
|
- sub_info.indus_kind AS indusKind,
|
|
|
- sub_info.is_rg AS isRg,
|
|
|
- sub_info.abc AS abc
|
|
|
- FROM sub_fix
|
|
|
- LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
|
|
|
- WHERE
|
|
|
- sub_fix.cat = #{queryVO.stateFix}
|
|
|
- AND sub_fix.year = #{queryVO.year}
|
|
|
- AND sub_info.logic_delete_flag = 0
|
|
|
- <if test="queryVO.subName != null and queryVO.subName != ''">
|
|
|
- AND sub_info.sub_name LIKE CONCAT('%', #{queryVO.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="queryVO.subjectId != null and queryVO.subjectId != ''">
|
|
|
- AND sub_info.subject_id = #{queryVO.subjectId}
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND sub_info.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND sub_info.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="queryVO.sbdw != null and queryVO.sbdw != ''">
|
|
|
- AND sub_info.unit_desc LIKE CONCAT('%', #{queryVO.sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="queryVO.startAmt != null and queryVO.startAmt != ''">
|
|
|
- AND sub_info.amt_total >= #{queryVO.startAmt}
|
|
|
- </if>
|
|
|
- <if test="queryVO.endAmt != null and queryVO.endAmt != ''">
|
|
|
- AND sub_info.amt_total <= #{queryVO.endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="subFixGetAll" resultType="com.rtrh.projects.modules.projects.vo.SubFixListVo">
|
|
|
- select
|
|
|
- b.id as id,
|
|
|
- b.sub_name as subName,
|
|
|
- b.subject_id as subjectId,
|
|
|
- b.content as content,
|
|
|
- b.amt_total as amtTotal,
|
|
|
- b.progress as progress,
|
|
|
- b.remark as remark,
|
|
|
- b.begin_date as beginDate,
|
|
|
- b.end_date as endDate,
|
|
|
- b.rt_date as rtDate
|
|
|
- from sub_fix a left join sub_info b on a.sub_id = b.id
|
|
|
- where a.cat = #{queryVO.stateFix} and a.year = #{queryVO.year} and b.logic_delete_flag = 0
|
|
|
- <if test="queryVO.subName != null and queryVO.subName != ''">
|
|
|
- AND b.sub_name LIKE CONCAT('%', #{queryVO.subName}, '%')
|
|
|
- </if>
|
|
|
- <if test="queryVO.subjectId != null and queryVO.subjectId != ''">
|
|
|
- AND b.subject_id = #{queryVO.subjectId}
|
|
|
- </if>
|
|
|
- <if test="indusKinds != null and indusKinds.size() > 0">
|
|
|
- AND b.indus_kind IN
|
|
|
- <foreach collection="indusKinds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="subjectIds != null and subjectIds.size() > 0">
|
|
|
- AND b.subject_id IN
|
|
|
- <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="queryVO.sbdw != null and queryVO.sbdw != ''">
|
|
|
- AND b.unit_desc LIKE CONCAT('%', #{queryVO.sbdw}, '%')
|
|
|
- </if>
|
|
|
- <if test="queryVO.startAmt != null and queryVO.startAmt != ''">
|
|
|
- AND b.amt_total >= #{queryVO.startAmt}
|
|
|
- </if>
|
|
|
- <if test="queryVO.endAmt != null and queryVO.endAmt != ''">
|
|
|
- AND b.amt_total <= #{queryVO.endAmt}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <!--预警-->
|
|
|
- <select id="queryWarning" resultType="java.lang.Long">
|
|
|
- SELECT SUM(counts)
|
|
|
- FROM (
|
|
|
- -- 已签约预警(未转新建)
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE cb_status = 3
|
|
|
- AND qy_date IS NOT NULL
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) > NOW()
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) < DATE_ADD(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 1
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 新建未转在建预警
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE begin_date > NOW()
|
|
|
- AND begin_date < DATE_ADD(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 2
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 在建未转投产预警
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE end_date > NOW()
|
|
|
- AND end_date < DATE_ADD(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 3
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 投产未入规预警
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE rt_date > NOW()
|
|
|
- AND rt_date < DATE_ADD(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 9
|
|
|
- AND is_rg = 0
|
|
|
- ) AS combined_counts;
|
|
|
- </select>
|
|
|
- <!-- 超期 -->
|
|
|
- <select id="queryExceed" resultType="java.lang.Long">
|
|
|
- SELECT SUM(counts) AS total_count
|
|
|
- FROM (
|
|
|
- -- 已签约(未转新建)
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE cb_status = 3
|
|
|
- AND qy_date IS NOT NULL
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) < NOW()
|
|
|
- AND `status` = 1
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 新建未转在建
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- begin_date < NOW()
|
|
|
- AND `status` = 2
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 在建未转投产
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE end_date < NOW()
|
|
|
- AND `status` = 3
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 投产未入规
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE rt_date < NOW()
|
|
|
- AND is_rg = 0
|
|
|
- AND `status` = 9
|
|
|
- ) AS combined_counts;
|
|
|
- </select>
|
|
|
- <!-- 绿灯 未超期-->
|
|
|
- <select id="queryNotExceed" resultType="java.lang.Long">
|
|
|
- SELECT SUM(counts) AS total_count
|
|
|
- FROM (
|
|
|
- -- 已签约绿灯(未转新建)
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE cb_status = 3
|
|
|
- AND qy_date IS NOT NULL
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) > NOW()
|
|
|
- AND `status` = 1
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 新建未转在建
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- begin_date > NOW()
|
|
|
- AND `status` = 2
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 在建未转投产
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- end_date > NOW()
|
|
|
- AND `status` = 3
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 投产未入规
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- rt_date > NOW()
|
|
|
- AND is_rg = 0
|
|
|
- AND `status` = 9
|
|
|
- ) AS combined_counts;
|
|
|
- </select>
|
|
|
- <!-- 黄灯超期3天内 -->
|
|
|
- <select id="queryExceedWithin" resultType="java.lang.Long">
|
|
|
- SELECT SUM(counts) AS total_count
|
|
|
- FROM (
|
|
|
- -- 已签约(未转新建)
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE cb_status = 3
|
|
|
- AND qy_date IS NOT NULL
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) > DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) < NOW()
|
|
|
- AND `status` = 1
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 新建未转在建
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- begin_date > DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND begin_date < NOW()
|
|
|
- AND `status` = 2
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 在建未转投产
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- end_date > DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND end_date < NOW()
|
|
|
- AND `status` = 3
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 投产未入规
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- rt_date > DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND rt_date < NOW()
|
|
|
- AND is_rg = 0
|
|
|
- AND `status` = 9
|
|
|
- ) AS combined_counts;
|
|
|
- </select>
|
|
|
- <!-- 红灯超期3天 -->
|
|
|
- <select id="queryExceedOutside" resultType="java.lang.Long">
|
|
|
- SELECT SUM(counts) AS total_count
|
|
|
- FROM (
|
|
|
- -- 已签约(未转新建)
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE cb_status = 3
|
|
|
- AND qy_date IS NOT NULL
|
|
|
- AND DATE_ADD(qy_date, INTERVAL cb_num DAY) < DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 1
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 新建未转在建
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- begin_date < DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 2
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 在建未转投产
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE end_date < DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND `status` = 3
|
|
|
-
|
|
|
- UNION ALL
|
|
|
-
|
|
|
- -- 投产未入规
|
|
|
- SELECT COUNT(*) AS counts
|
|
|
- FROM sub_info
|
|
|
- WHERE rt_date < DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
- AND is_rg = 0
|
|
|
- AND `status` = 9
|
|
|
- ) AS combined_counts;
|
|
|
- </select>
|
|
|
- <!-- 储备转新建超期统计 -->
|
|
|
- <select id="queryExceedCbToXj" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT
|
|
|
- a.subject_id subjectId,
|
|
|
- a.indus_kind indusKind,
|
|
|
- a.amt_total amtTotal
|
|
|
- FROM
|
|
|
- sub_info a
|
|
|
- WHERE
|
|
|
- a.STATUS = '1'
|
|
|
- AND ( a.cb_status = '3' OR a.cb_status = '4' OR a.cb_status = '5' )
|
|
|
- AND DATE_ADD( a.qy_date, INTERVAL ifnull( cb_num, 0 ) DAY ) <= now()
|
|
|
- AND a.logic_delete_flag = 0
|
|
|
- </select>
|
|
|
- <select id="queryWarningStatistics" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT
|
|
|
- id,
|
|
|
- STATUS,
|
|
|
- cb_status cbStatus,
|
|
|
- qy_date qyDate,
|
|
|
- begin_date beginDate,
|
|
|
- end_date endDate,
|
|
|
- rt_date rtDate
|
|
|
- FROM
|
|
|
- sub_info
|
|
|
- WHERE
|
|
|
- logic_delete_flag = 0
|
|
|
- </select>
|
|
|
- <select id="queryExceedXjToZj" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT subject_id subjectId,
|
|
|
- indus_kind indusKind,
|
|
|
- amt_total amtTotal
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- begin_date <= NOW()
|
|
|
- AND `status` = 2
|
|
|
- AND logic_delete_flag = 0
|
|
|
- </select>
|
|
|
- <select id="queryExceedZjTotc" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT subject_id subjectId,
|
|
|
- indus_kind indusKind,
|
|
|
- amt_total amtTotal
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- end_date <= NOW()
|
|
|
- AND `status` = 3
|
|
|
- AND logic_delete_flag = 0
|
|
|
- </select>
|
|
|
- <select id="queryExceedTcToRg" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT subject_id subjectId,
|
|
|
- indus_kind indusKind,
|
|
|
- amt_total amtTotal
|
|
|
- FROM sub_info
|
|
|
- WHERE
|
|
|
- rt_date <= NOW()
|
|
|
- AND (is_rg = 0 or is_rg is null)
|
|
|
- AND `status` = 9
|
|
|
- and rt_date is not null
|
|
|
- and logic_delete_flag=0
|
|
|
- </select>
|
|
|
- <select id="preProcedureExceed" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT
|
|
|
- c.subject_id subjectId,
|
|
|
- c.indus_kind indusKind,
|
|
|
- c.amt_total amtTotal
|
|
|
- FROM
|
|
|
- sub_pre_new a
|
|
|
- LEFT JOIN sub_info c ON a.sub_id = c.id
|
|
|
- WHERE
|
|
|
- c.logic_delete_flag = 0
|
|
|
- AND a.logic_delete_flag = 0
|
|
|
- AND a.`status` = 1
|
|
|
- AND (
|
|
|
- ( status_conf = '1' AND DATE_ADD( a.date_plan, INTERVAL a.num2 DAY ) < NOW() )
|
|
|
- OR ( status_conf = '2' AND DATE_ADD( a.date_plan, INTERVAL a.num2 DAY ) < a.date_confirm )
|
|
|
- )
|
|
|
- and c.indus_kind in('210','99','2')
|
|
|
- GROUP BY
|
|
|
- a.id
|
|
|
- </select>
|
|
|
- <select id="queryExceedMonthly" resultType="com.rtrh.projects.modules.projects.vo.WorkBenchVO">
|
|
|
- SELECT
|
|
|
- a.subject_id subjectId,
|
|
|
- a.indus_kind indusKind,
|
|
|
- a.amt_total amtTotal
|
|
|
- FROM
|
|
|
- sub_info a
|
|
|
- LEFT JOIN sub_rpt_cont src ON src.sub_id = a.id
|
|
|
- AND src.kind = '1'
|
|
|
- AND src.kj_month LIKE #{lastMonth}
|
|
|
- WHERE
|
|
|
- a.logic_delete_flag = 0
|
|
|
- AND a.`status` = '7'
|
|
|
- and a.indus_kind in('210','99','2')
|
|
|
- AND src.id IS NULL
|
|
|
- GROUP BY
|
|
|
- a.id
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getSubInfoByFgwId" resultType="map" parameterType="string">
|
|
|
- SELECT
|
|
|
- sa.yearAmt,
|
|
|
- src.yearAmtSj,
|
|
|
- src.yearAmtRt,
|
|
|
- IF
|
|
|
- ( sa.yearAmt != 0, ROUND(( src.yearAmtSj - sa.yearAmt ) * 100 / sa.yearAmt, 2 ), NULL ) AS `offset`,
|
|
|
- sqi.title problemReason,
|
|
|
- IF
|
|
|
- ( us.id IS NULL, 0, 1 ) AS isBl,
|
|
|
- a.*,
|
|
|
- b.title AS unitName,
|
|
|
- f.title AS mainName,
|
|
|
- c.title AS indusName,
|
|
|
- d.title AS manageName,
|
|
|
- e.title subjectId
|
|
|
- FROM
|
|
|
- sub_info a
|
|
|
- LEFT JOIN j_unit b ON a.unit_id = b.id
|
|
|
- LEFT JOIN j_unit d ON a.manage_id = d.id
|
|
|
- LEFT JOIN j_unit f ON a.main_id = f.id
|
|
|
- LEFT JOIN t_systable c ON a.indus_kind = c.id
|
|
|
- LEFT JOIN t_systable e ON a.subject_id = e.id
|
|
|
- LEFT JOIN sec_user_sub us ON a.id = us.sub_id
|
|
|
- AND us.logic_delete_flag = 0
|
|
|
- LEFT JOIN sub_q_info sqi ON sqi.sub_id = a.id
|
|
|
- AND sqi.logic_delete_flag = 0
|
|
|
- AND sqi.`status` = '0'
|
|
|
- AND sqi.kind = 2
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- sum( amt ) yearAmt,
|
|
|
- sa.sub_id
|
|
|
- FROM
|
|
|
- sub_amtplan sa
|
|
|
- WHERE
|
|
|
- sa.logic_delete_flag = 0
|
|
|
- AND sa.y_month >= #{queryYear}
|
|
|
- AND sa.y_month <= #{queryYear}
|
|
|
- GROUP BY
|
|
|
- sa.sub_id
|
|
|
- ) sa ON sa.sub_id = a.id
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- sum( amt ) yearAmtSj,
|
|
|
- sum( amt_rt ) yearAmtRt,
|
|
|
- src.sub_id
|
|
|
- FROM
|
|
|
- sub_rpt_cont src
|
|
|
- WHERE
|
|
|
- src.logic_delete_flag = 0
|
|
|
- AND src.kj_month >= #{queryYear}
|
|
|
- AND src.kj_month <= #{queryYear}
|
|
|
- GROUP BY
|
|
|
- src.sub_id
|
|
|
- ) src ON src.sub_id = a.id
|
|
|
- WHERE
|
|
|
- a.id = #{id}
|
|
|
- GROUP BY
|
|
|
- a.id
|
|
|
- </select>
|
|
|
-</mapper>
|