| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 |
- <?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="cn.com.goldenwater.dcproj.dao.TacProvincePblmInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo" id="tacProvincePblmInfoResultMap">
- <result property="id" column="ID"/>
- <result property="objType" column="OBJ_TYPE"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="pblmNm" column="PBLM_NM"/>
- <result property="pblmPasi" column="PBLM_PASI"/>
- <result property="ifCasePblm" column="IF_CASE_PBLM"/>
- <result property="subjectIds" column="SUBJECT_IDS"/>
- <result property="subjectNames" column="SUBJECT_NAMES"/>
- <result property="pblmDesc" column="PBLM_DESC" />
- <result property="pblmReason" column="PBLM_REASON"/>
- <result property="pblmSggtn" column="PBLM_SGGTN"/>
- <result property="pblmSn" column="PBLM_SN"/>
- <result property="pblmstdId" column="PBLMSTD_ID"/>
- <result property="rectId" column="RECT_ID"/>
- <result property="rgstrId" column="RGSTR_ID"/>
- <result property="listType" column="LIST_TYPE"/>
- <result property="listId" column="LIST_ID"/>
- <result property="hasVedio" column="HAS_VEDIO"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="persId" column="PERS_ID"/>
- <result property="persNm" column="PERS_NM"/>
- <result property="intm" column="INTM"/>
- <result property="spclId" column="SPCL_ID"/>
- <result property="spclNm" column="SPCL_NM"/>
- <result property="spclRvwOptn" column="SPCL_RVW_OPTN"/>
- <result property="spclTm" column="SPCL_TM"/>
- <result property="uptm" column="UPTM"/>
- <result property="note" column="NOTE"/>
- <result property="pblmQlttvCd" column="PBLM_QLTTV_CD"/>
- <result property="pblmQlttvNm" column="PBLM_QLTTV_NM"/>
- <result property="isCpQa" column="IS_CP_QA"/>
- <result property="pblmTypeDesc" column="PBLM_TYPE_DESC"/>
- <result property="taskId" column="TASK_ID"/>
- <result property="stepId" column="STEP_ID"/>
- <result property="oldPblmId" column="old_pblm_id"/>
- <result property="state" column="STATE"/>
- <result property="province" column="PROVINCE"/>
- <result property="sn" column="SN"/>
- <result property="pblmRevision" column="PBLM_REVISION"/>
- <result property="pblmRevisionProof" column="PBLM_REVISION_PROOF"/>
- <result property="pblmMendNote" column="PBLM_MEND_NOTE"/>
- <result property="pblmMendState" column="PBLM_MEND_STATE"/>
- <result property="pblmMendPersNm" column="PBLM_MEND_PERS_NM"/>
- <result property="pblmMendPersId" column="PBLM_MEND_PERS_ID"/>
- <result property="pblmMendTm" column="PBLM_MEND_TM"/>
- <result property="isPoverty" column="IS_POVERTY"/>
- <result property="relativeLaw" column="RELATIVE_LAW"/>
- <result property="lawContent" column="LAW_CONTENT"/>
- </resultMap>
- <sql id="table_columns">
- ID,STEP_ID,old_pblm_id,STATE,PROVINCE,SN,
- OBJ_TYPE,
- OBJ_ID,
- PBLM_NM,
- PBLM_PASI,
- IF_CASE_PBLM,
- SUBJECT_IDS,
- SUBJECT_NAMES,
- PBLM_DESC,
- PBLM_REASON,
- PBLM_SGGTN,
- PBLM_SN,
- PBLMSTD_ID,
- RECT_ID,
- RGSTR_ID,
- LIST_TYPE,
- LIST_ID,
- HAS_VEDIO,
- GROUP_ID,
- PERS_ID,
- PERS_NM,
- INTM,
- SPCL_ID,
- SPCL_NM,
- SPCL_RVW_OPTN,
- SPCL_TM,
- UPTM,
- NOTE,
- PBLM_QLTTV_CD,
- PBLM_QLTTV_NM,
- IS_CP_QA,
- PBLM_TYPE_DESC,
- TASK_ID,
- PBLM_REVISION,
- PBLM_REVISION_PROOF,
- PBLM_MEND_NOTE,
- PBLM_MEND_STATE,
- PBLM_MEND_PERS_NM,
- PBLM_MEND_PERS_ID,
- PBLM_MEND_TM,
- RELATIVE_LAW,
- LAW_CONTENT
- </sql>
- <sql id="entity_properties">
- #{id},#{stepId},#{oldPblmId},#{state},#{province},#{sn},
- #{objType},
- #{objId},
- #{pblmNm},
- #{pblmPasi},
- #{ifCasePblm},
- #{subjectIds},
- #{subjectNames},
- #{pblmDesc},
- #{pblmReason},
- #{pblmSggtn},
- #{pblmSn},
- #{pblmstdId},
- #{rectId},
- #{rgstrId},
- #{listType},
- #{listId},
- #{hasVedio},
- #{groupId},
- #{persId},
- #{persNm},
- #{intm},
- #{spclId},
- #{spclNm},
- #{spclRvwOptn},
- #{spclTm},
- #{uptm},
- #{note},
- #{pblmQlttvCd},
- #{pblmQlttvNm},
- #{isCpQa},
- #{pblmTypeDesc},
- #{taskId},
- #{pblmRevision},
- #{pblmRevisionProof},
- #{pblmMendNote},
- #{pblmMendState},
- #{pblmMendPersNm},
- #{pblmMendPersId},
- #{pblmMendTm},
- #{relativeLaw},
- #{lawContent}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
- <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
- <if test="stepId != null and stepId != ''">and STEP_ID = #{stepId}</if>
- <if test="pblmNm != null and pblmNm != ''">and PBLM_NM like '%${pblmNm}%'</if>
- <if test="pblmPasi != null and pblmPasi != ''">and PBLM_PASI = #{pblmPasi}</if>
- <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
- <if test="subjectIds != null and subjectIds != ''">and SUBJECT_IDS = #{subjectIds}</if>
- <if test="subjectNames != null and subjectNames != ''">and SUBJECT_NAMES = #{subjectNames}</if>
- <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
- <if test="pblmReason != null and pblmReason != ''">and PBLM_REASON = #{pblmReason}</if>
- <if test="pblmSggtn != null and pblmSggtn != ''">and PBLM_SGGTN = #{pblmSggtn}</if>
- <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
- <if test="pblmstdId != null and pblmstdId != ''">and PBLMSTD_ID = #{pblmstdId}</if>
- <if test="rectId != null and rectId != ''">and RECT_ID = #{rectId}</if>
- <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
- <if test="listType != null and listType != ''">and LIST_TYPE = #{listType}</if>
- <if test="listId != null and listId != ''">and LIST_ID = #{listId}</if>
- <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="persNm != null and persNm != ''">and PERS_NM = #{persNm}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="spclId != null and spclId != ''">and SPCL_ID = #{spclId}</if>
- <if test="spclNm != null and spclNm != ''">and SPCL_NM = #{spclNm}</if>
- <if test="spclRvwOptn != null and spclRvwOptn != ''">and SPCL_RVW_OPTN = #{spclRvwOptn}</if>
- <if test="spclTm != null">and SPCL_TM = #{spclTm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="pblmQlttvCd != null and pblmQlttvCd != ''">and PBLM_QLTTV_CD = #{pblmQlttvCd}</if>
- <if test="pblmQlttvNm != null and pblmQlttvNm != ''">and PBLM_QLTTV_NM = #{pblmQlttvNm}</if>
- <if test="isCpQa != null and isCpQa != ''">and IS_CP_QA = #{isCpQa}</if>
- <if test="pblmTypeDesc != null and pblmTypeDesc != ''">and PBLM_TYPE_DESC = #{pblmTypeDesc}</if>
- <if test="taskId != null and taskId != ''">and TASK_ID = #{taskId}</if>
- <if test="pblmRevision != null and pblmRevision != ''">and PBLM_REVISION = #{pblmRevision}</if>
- <if test="pblmRevisionProof != null and pblmRevisionProof != ''">and PBLM_REVISION_PROOF = #{pblmRevisionProof}</if>
- <if test="pblmMendNote != null and pblmMendNote != ''">and PBLM_MEND_NOTE = #{pblmMendNote}</if>
- <if test="pblmMendState != null and pblmMendState != ''">and PBLM_MEND_STATE = #{pblmMendState}</if>
- <if test="pblmMendPersNm != null and pblmMendPersNm != ''">and PBLM_MEND_PERS_NM = #{pblmMendPersNm}</if>
- <if test="pblmMendPersId != null and pblmMendPersId != ''">and PBLM_MEND_PERS_ID = #{pblmMendPersId}</if>
- <if test="pblmMendTm != null and pblmMendTm != ''">and PBLM_MEND_TM = #{pblmMendTm}</if>
- <if test="relativeLaw != null and relativeLaw != ''">and RELATIVE_LAW like '%${relativeLaw}%'</if>
- <if test="lawContent != null and lawContent != ''">and LAW_CONTENT like '%${lawContent}%' </if>
- </trim>
- </sql>
- <select id="get" resultMap="tacProvincePblmInfoResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacProvincePblmInfoResultMap">
- select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacProvincePblmInfoResultMap">
- select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO
- </select>
- <select id="findPageJieduanInfo" resultMap="tacProvincePblmInfoResultMap">
- select t.*,r.location,r.name,r.ad_code,r.IS_POVERTY
- from TAC_PROVINCE_PBLM_INFO t,TAC_PAWP_RGSTR r ,TAC_INSP_YEAR_BATCH_OBJ o
- where r.id=t.rgstr_id and o.id = t.obj_id
- <include refid="jieduanSql"/>
- order by t.rgstr_id, t.list_type asc, t.pblm_pasi desc, t.SN ASC
- </select>
- <select id="finalResults" resultType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfoReDto">
- select
- t.*,
- r.name objName,
- r.location,
- r.ad_code adcodecounty
- from TAC_PBLM_INFO t
- left join TAC_PAWP_RGSTR r on r.id = t.rgstr_id
- left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.OBJ_ID
- where 1=1
- <!--<if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>-->
- <if test="objName != null and objName != ''">and r.name like '%${objName}%'</if>
- <if test="year != null and year != ''">and o.YEAR = #{year}</if>
- <if test="pblmNm != null and pblmNm != ''">and t.PBLM_NM like '%${pblmNm}%' </if>
- <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
- <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
- <if test="adCode != null and adCode != ''">and r.AD_CODE like '${adCode}%' </if>
- order by t.intm desc
- </select>
- <sql id="jieduanSql">
- <if test="rgstrId != null and rgstrId != ''">and t.RGSTR_ID like '${rgstrId}%'</if>
- <include refid="mySearch"/>
- </sql>
- <sql id="mySearch">
- <if test="year != null and year != ''">and o.YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and o.BATCH = #{batch}</if>
- <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
- <if test="hasVedio != null and hasVedio != ''">and t.HAS_VEDIO = #{hasVedio}</if>
- <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
- <if test="pblmQlttvCd != null and pblmQlttvCd != ''">and t.PBLM_QLTTV_CD = #{pblmQlttvCd}</if>
- <if test="pblmQlttvNm != null and pblmQlttvNm != ''">and t.PBLM_QLTTV_NM = #{pblmQlttvNm}</if>
- <if test="adCode != null and adCode != ''">and r.AD_CODE = #{adCode}</if>
- <if test="objId != null and objId != ''">and r.OBJ_ID = #{objId}</if>
- <if test="ifCasePblm != null and ifCasePblm != ''">and t.IF_CASE_PBLM = #{ifCasePblm}</if>
- <if test="subjectNames != null and subjectNames != ''">and t.subject_Names like '%${subjectNames}%'</if>
- <if test="groupId != null and groupId != ''">and r.GROUP_ID = #{groupId}</if>
- <if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>
- <if test="isJoinRec != null and isJoinRec != ''">
- <if test="isJoinRec =='0'.toString()">
- and t.id not in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
- </if>
- <if test="isJoinRec =='1'.toString()">
- and t.id in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
- </if>
- </if>
- <include refid="choseSql"/>
- <if test="pblmNm != null and pblmNm != ''">
- and t.PBLM_NM like '%${pblmNm}%'
- </if>
- <if test="pblmMendState != null and pblmMendState != ''"> AND T.PBLM_MEND_STATE = #{pblmMendState}</if>
- and o.YEAR is not null
- </sql>
- <sql id="choseSql" >
- <choose>
- <when test="province !=null and province !=''">
- and t.province=#{province}
- </when>
- <otherwise>
- and t.province is null
- </otherwise>
- </choose>
- </sql>
- <select id="findList" resultMap="tacProvincePblmInfoResultMap">
- select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
- order by state desc,intm desc
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
- insert into TAC_PROVINCE_PBLM_INFO( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_PROVINCE_PBLM_INFO where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
- delete from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_PROVINCE_PBLM_INFO set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
- update TAC_PROVINCE_PBLM_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
- <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
- <if test="sn != null and sn != ''"> SN = #{sn},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
- <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
- <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
- <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
- <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
- <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
- <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
- <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
- <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
- <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
- <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
- <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
- <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
- <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
- <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
- <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
- <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
- <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
- <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{pblmMendState},</if>
- <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{pblmMendPersNm},</if>
- <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
- <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
- <if test="relativeLaw != null and relativeLaw != ''"> RELATIVE_LAW = #{relativeLaw} , </if>
- <if test="lawContent != null and lawContent != ''"> LAW_CONTENT = #{lawContent}, </if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
- update TAC_PROVINCE_PBLM_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
- <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
- <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
- <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
- <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
- <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
- <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
- <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
- <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
- <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
- <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
- <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
- <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
- <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
- <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
- <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
- <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
- <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
- <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
- <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
- <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
- <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{PBLM_MEND_STATE},</if>
- <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{PBLM_MEND_PERS_NM},</if>
- <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
- <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
- <if test="relativeLaw != null "> RELATIVE_LAW = #{relativeLaw} , </if>
- <if test="lawContent != null "> LAW_CONTENT = #${lawContent}, </if>
- </trim>
- <include refid="page_where" />
- </update>
- <select id="countPblmInfoByStbJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- SELECT
- ( CASE WHEN count( * ) IS NULL THEN 0 ELSE count( * ) END ) AS count,
- DECODE( spfsnlType, '质量实体', '工程质量', '质量行为', '工程质量', '安全管理', '工程安全', spfsnlType ) AS name,
- pblmType,
- pblmPasi AS code
- FROM
- (
- SELECT
- (case when tb.SPFSNL_TYPE='计划管理' then '计划下达与执行' else tb.SPFSNL_TYPE end) AS spfsnlType,
- t.PBLM_PASI AS pblmPasi,
- tb.pblm_type AS pblmType,
- t.PBLM_NM
- FROM
- TAC_PROVINCE_PBLM_INFO t
- LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
- LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
- WHERE
- o.id IS NOT NULL
- AND t.pblm_pasi IS NOT NULL
- AND tb.id IS NOT NULL
- <include refid="choseSql"/>
- <if test="year != null">and o.year = #{year}
- </if>
- <if test="batch != null">and o.batch = #{batch}
- </if>
- <if test="type != null and type != ''">and r.type = #{type}
- </if>
- <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
- </if>
- <if test="state != null and state != ''">
- and r.state = #{state}
- </if>
- <if test="searchStat != null and searchStat != ''">
- and t.RGSTR_ID like '%_${searchStat}'
- </if>
- <if test="objId != null and objId != ''">
- and t.obj_id = #{objId}
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- )
- WHERE
- spfsnlType NOT IN ( '质量管理—实体质量', '计划管理' )
- GROUP BY
- spfsnlType,
- pblmType,
- pblmPasi
- ORDER BY
- pblmType
- </select>
- <select id="countIfCasePblmJdNew" resultType="java.lang.Integer">
- SELECT
- count(*)
- FROM
- TAC_PROVINCE_PBLM_INFO t
- LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
- LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
- WHERE
- t.pblm_pasi IS NOT NULL
- AND tb.id IS NOT NULL
- <if test="year != null">and o.year = #{year}
- </if>
- <if test="batch != null">and o.batch = #{batch}
- </if>
- <if test="type != null and type != ''">and r.type = #{type}
- </if>
- <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
- </if>
- <if test="state != null and state != ''">
- and r.state = #{state}
- </if>
- <if test="searchStat != null and searchStat != ''">
- and t.RGSTR_ID like '%_${searchStat}'
- </if>
- <if test="objId != null and objId != ''">
- and t.obj_id = #{objId}
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- <choose>
- <when test="ifCasePblm == 1">
- and t.IF_CASE_PBLM = 1
- </when>
- <otherwise>
- and (t.IF_CASE_PBLM = 0 or t.IF_CASE_PBLM is null)
- </otherwise>
- </choose>
- </select>
- <select id="countPblmInfoBySubJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select t.SYS_TYPE as code,t.pblm_pasi as name, count(*) as count from (
- select distinct t.id,t.pblm_pasi,os.SYS_TYPE from TAC_PROVINCE_PBLM_INFO t left join
- TAC_PAWP_RGSTR r on t.obj_id = r.obj_id left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.obj_id
- left join TAC_PBLM_SUBJECT s on t.id = s.pblm_id left join tac_obj_subject os on s.sub_id = os.ID
- where t.pblm_pasi is not null and s.id is not null and s.sub_id is not null
- <include refid="choseSql"/>
- <if test="year != null">
- and o.year ='2020'
- </if>
- <if test="batch != null">
- and o.batch = #{batch}
- </if>
- <if test="type != null and type != ''">
- and r.type = #{type}
- </if>
- <if test="isPoverty != null and isPoverty != ''">
- and r.IS_POVERTY = #{isPoverty}
- </if>
- <if test="state != null and state != ''">
- and r.state = #{state}
- </if>
- <if test="searchStat != null and searchStat != ''">
- and t.RGSTR_ID like '%_${searchStat}'
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- ) t group by t.SYS_TYPE,t.pblm_pasi
- </select>
- <select id="countPblmInfoByAdCodeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- select AD_Code as code, PBLM_PASI AS name, count(*) as count
- from (
- select t.*, a.ad_code, a.ad_name
- from TAC_PROVINCE_PBLM_INFO t
- left join TAC_PAWP_RGSTR r on t.obj_id = r.obj_id
- left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.obj_id
- left join TAC_INSP_YEAR_BATCH_AREA a on a.GROUP_ID=o.GROUP_ID
- where r.id is not null
- and t.pblm_pasi is not null
- <include refid="choseSql"/>
- <if test="year != null">
- and o.year = #{year}
- </if>
- <if test="batch != null">
- and o.batch = #{batch}
- </if>
- <if test="type != null and type != ''">
- and r.type = #{type}
- </if>
- <if test="isPoverty != null and isPoverty != ''">
- and r.IS_POVERTY = #{isPoverty}
- </if>
- <if test="state != null and state != ''">
- and r.state = #{state}
- </if>
- <if test="searchStat != null and searchStat != ''">
- and t.RGSTR_ID like '%_${searchStat}'
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- ) group by AD_Code, AD_Name,PBLM_PASI order by COUNT desc
- </select>
- <select id="countPblmInfoByObjTypeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- WITH O AS (
- SELECT B.TYPE AS NAME,
- COUNT(T.ID) PBLM_SIZE
- FROM TAC_INSP_YEAR_BATCH_OBJ O
- JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
- LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
- LEFT JOIN TAC_PROVINCE_PBLM_INFO T ON T.RGSTR_ID = R.ID
- WHERE B.TYPE IS NOT NULL
- <include refid="choseSql"/>
- <if test="year != null">
- and O.year = #{year}
- </if>
- <if test="batch != null">
- and O.batch = #{batch}
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- GROUP BY B.TYPE
- )
- SELECT name, SUM(PBLM_SIZE) AS count FROM O
- GROUP BY name
- ORDER BY name
- </select>
- <select id="countPblmInfoByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- SELECT
- count( * ) AS count,
- a.showName,
- a.name
- FROM
- (
- SELECT
- t.LIST_TYPE as name,
- tp.PBLM_TYPE_DESC AS showName
- FROM
- TAC_PROVINCE_PBLM_INFO t
- LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
- LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
- WHERE
- t.PBLMSTD_ID IS NOT NULL
- AND tp.id IS NOT NULL
- and tp.PBLM_TYPE_DESC is not null
- and tp.PBLM_TYPE_DESC !='其他'
- <include refid="choseSql"/>
- <if test="year !=null">
- and o.year = #{year}
- </if>
- <if test="batch != null">
- and o.batch = #{batch}
- </if>
- <if test="stbClaName != null and stbClaName != ''">
- and t.LIST_TYPE = #{stbClaName}
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- ) A
- GROUP BY
- a.showName,
- a.name
- ORDER BY
- a.showName
- </select>
- <select id="countPblmInfoObjByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
- SELECT
- count( * ) AS count,
- a.showName,
- a.name
- FROM
- (
- SELECT
- DISTINCT
- t.PBLMSTD_ID,
- tp.PBLM_TYPE_DESC AS showName,
- t.LIST_TYPE as name
- FROM
- TAC_PROVINCE_PBLM_INFO t
- LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
- LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
- WHERE
- t.PBLMSTD_ID IS NOT NULL
- AND tp.id IS NOT NULL
- and tp.PBLM_TYPE_DESC is not null
- and tp.PBLM_TYPE_DESC !='其他'
- <include refid="choseSql"/>
- <if test="year !=null">
- and o.year = #{year}
- </if>
- <if test="batch != null">
- and o.batch = #{batch}
- </if>
- <if test="stbClaName != null and stbClaName != ''">
- and t.LIST_TYPE = #{stbClaName}
- </if>
- <if test="rgstrId != null and rgstrId !=''">
- and t.STEP_ID= #{rgstrId}
- </if>
- ) A
- GROUP BY
- a.name,a.showName
- ORDER BY
- a.showName
- </select>
- </mapper>
|