| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 |
- <?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.TacPawpRgstrDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpRgstr" id="tacPawpRgstrResultMap">
- <result property="id" column="ID"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="name" column="NAME"/>
- <result property="admOrg" column="ADM_ORG"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="location" column="LOCATION"/>
- <result property="type" column="TYPE"/>
- <result property="itmeDesc" column="ITME_DESC"/>
- <result property="itmeEval" column="ITME_EVAL"/>
- <result property="katalog" column="KATALOG"/>
- <result property="spcltYm" column="SPCLT_YM"/>
- <result property="revOpin" column="REV_OPIN"/>
- <result property="revTm" column="REV_TM"/>
- <result property="centerX" column="CENTER_X"/>
- <result property="centerY" column="CENTER_Y"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- <result property="note" column="NOTE"/>
- <result property="state" column="STATE"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="pdbstStat" column="PDBST_STAT"/>
- <result property="bstocmPlprsStat" column="BSTOCM_PLPRS_STAT"/>
- <result property="bstocmTsopbfpStat" column="BSTOCM_TSOPBFP_STAT"/>
- <result property="bstocmCpssStat" column="BSTOCM_CPSS_STAT"/>
- <result property="bstocmCmsStat" column="BSTOCM_CMS_STAT"/>
- <result property="raiobisStat" column="RAIOBIS_STAT"/>
- <result property="biofuamStat" column="BIOFUAM_STAT"/>
- <result property="bitopqQmsStat" column="BITOPQ_QMS_STAT"/>
- <result property="bitopqPeqaaStat" column="BITOPQ_PEQAA_STAT"/>
- <result property="bioesPeStat" column="BIOES_PE_STAT"/>
- <result property="bioesRwunitStat" column="BIOES_RWUNIT_STAT"/>
- <result property="persId" column="PERS_ID"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="adName" column="AD_NAME"/>
- <result property="isPoverty" column="IS_POVERTY"/>
- <result property="province" column="PROVINCE"/>
- <result property="taskId" column="TASK_ID"/>
- </resultMap>
- <sql id="table_columns">
- ID,TASK_ID,
- OBJ_ID,
- NAME,
- ADM_ORG,
- AD_CODE,
- LOCATION,
- TYPE,
- ITME_DESC,
- ITME_EVAL,
- KATALOG,
- SPCLT_YM,
- REV_OPIN,
- REV_TM,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- NOTE,
- STATE,
- DATA_STAT,
- PDBST_STAT,
- BSTOCM_PLPRS_STAT,
- BSTOCM_TSOPBFP_STAT,
- BSTOCM_CPSS_STAT,
- BSTOCM_CMS_STAT,
- RAIOBIS_STAT,
- BIOFUAM_STAT,
- BITOPQ_QMS_STAT,
- BITOPQ_PEQAA_STAT,
- BIOES_PE_STAT,
- BIOES_RWUNIT_STAT,
- PERS_ID,
- GROUP_ID,
- INTM,
- UPTM,AD_NAME,IS_POVERTY,PROVINCE
- </sql>
- <sql id="entity_properties">
- #{id},#{taskId},
- #{objId},
- #{name},
- #{admOrg},
- #{adCode},
- #{location},
- #{type},
- #{itmeDesc},
- #{itmeEval},
- #{katalog},
- #{spcltYm},
- #{revOpin},
- #{revTm},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{note},
- #{state},
- #{dataStat},
- #{pdbstStat},
- #{bstocmPlprsStat},
- #{bstocmTsopbfpStat},
- #{bstocmCpssStat},
- #{bstocmCmsStat},
- #{raiobisStat},
- #{biofuamStat},
- #{bitopqQmsStat},
- #{bitopqPeqaaStat},
- #{bioesPeStat},
- #{bioesRwunitStat},
- #{persId},
- #{groupId},
- #{intm},
- #{uptm},#{adName},#{isPoverty},#{province}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
- <if test="name != null and name != ''">and NAME like '%${name}%'</if>
- <if test="admOrg != null and admOrg != ''">and ADM_ORG like '%${admOrg}%'</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="location != null and location != ''">and LOCATION like '%${location}%'</if>
- <if test="type != null and type != ''">and TYPE like '%${type}%' #{type}</if>
- <if test="itmeDesc != null and itmeDesc != ''">and ITME_DESC like '%${itmeDesc}%'</if>
- <if test="itmeEval != null and itmeEval != ''">and ITME_EVAL like '%${itmeEval}%'</if>
- <if test="katalog != null and katalog != ''">and KATALOG like '%${katalog}%'</if>
- <if test="spcltYm != null">and SPCLT_YM = #{spcltYm}</if>
- <if test="revOpin != null and revOpin != ''">and REV_OPIN like '%${revOpin}%'</if>
- <if test="revTm != null">and REV_TM = #{revTm}</if>
- <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
- <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
- <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
- <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
- <if test="note != null and note != ''">and NOTE like '%${note}%'</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="pdbstStat != null and pdbstStat != ''">and PDBST_STAT = #{pdbstStat}</if>
- <if test="bstocmPlprsStat != null and bstocmPlprsStat != ''">and BSTOCM_PLPRS_STAT = #{bstocmPlprsStat}</if>
- <if test="bstocmTsopbfpStat != null and bstocmTsopbfpStat != ''">and BSTOCM_TSOPBFP_STAT =
- #{bstocmTsopbfpStat}
- </if>
- <if test="bstocmCpssStat != null and bstocmCpssStat != ''">and BSTOCM_CPSS_STAT = #{bstocmCpssStat}</if>
- <if test="bstocmCmsStat != null and bstocmCmsStat != ''">and BSTOCM_CMS_STAT = #{bstocmCmsStat}</if>
- <if test="raiobisStat != null and raiobisStat != ''">and RAIOBIS_STAT = #{raiobisStat}</if>
- <if test="biofuamStat != null and biofuamStat != ''">and BIOFUAM_STAT = #{biofuamStat}</if>
- <if test="bitopqQmsStat != null and bitopqQmsStat != ''">and BITOPQ_QMS_STAT = #{bitopqQmsStat}</if>
- <if test="bitopqPeqaaStat != null and bitopqPeqaaStat != ''">and BITOPQ_PEQAA_STAT = #{bitopqPeqaaStat}</if>
- <if test="bioesPeStat != null and bioesPeStat != ''">and BIOES_PE_STAT = #{bioesPeStat}</if>
- <if test="bioesRwunitStat != null and bioesRwunitStat != ''">and BIOES_RWUNIT_STAT = #{bioesRwunitStat}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="isPoverty != null">and IS_POVERTY = #{isPoverty}</if>
- <if test="adName != null">and AD_NAME = #{adName}</if>
- <include refid="choseSql"/>
- </trim>
- </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="get" resultMap="tacPawpRgstrResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_RGSTR where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacPawpRgstrResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_RGSTR t
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="tacPawpRgstrResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_RGSTR t where 1=1
- <include refid="choseSql"/>
- </select>
- <select id="findList" resultMap="tacPawpRgstrResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_RGSTR t
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from TAC_PAWP_RGSTR t
- <include refid="page_where"/>
- </select>
- <!--获取助理数据-->
- <select id="findZhuli" resultType="String">
- select n.persid from bis_insp_all_rlation n where n.id in(
- select o.id from tac_pawp_rgstr r,bis_insp_all_obj o where r.obj_id=o.obj_id and r.id=#{regstrId} ) and
- n.pertype=19
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpRgstr">
- insert into TAC_PAWP_RGSTR(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_PAWP_RGSTR where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpRgstr">
- delete from TAC_PAWP_RGSTR t
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_PAWP_RGSTR set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpRgstr">
- update TAC_PAWP_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="admOrg != null">ADM_ORG = #{admOrg},</if>
- <if test="adCode != null">AD_CODE = #{adCode},</if>
- <if test="location != null">LOCATION = #{location},</if>
- <if test="isPoverty != null">IS_POVERTY = #{isPoverty},</if>
- <if test="adName != null">AD_NAME = #{adName},</if>
- <if test="type != null">TYPE = #{type},</if>
- <if test="itmeDesc != null">ITME_DESC = #{itmeDesc},</if>
- <if test="itmeEval != null">ITME_EVAL = #{itmeEval},</if>
- <if test="katalog != null">KATALOG = #{katalog},</if>
- <if test="spcltYm != null">SPCLT_YM = #{spcltYm},</if>
- <if test="revOpin != null">REV_OPIN = #{revOpin},</if>
- <if test="revTm != null">REV_TM = #{revTm},</if>
- <if test="centerX != null">CENTER_X = #{centerX},</if>
- <if test="centerY != null">CENTER_Y = #{centerY},</if>
- <if test="gdX != null">GD_X = #{gdX},</if>
- <if test="gdY != null">GD_Y = #{gdY},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="pdbstStat != null and pdbstStat != ''">PDBST_STAT = #{pdbstStat},</if>
- <if test="bstocmPlprsStat != null and bstocmPlprsStat != ''">BSTOCM_PLPRS_STAT = #{bstocmPlprsStat},</if>
- <if test="bstocmTsopbfpStat != null and bstocmTsopbfpStat != ''">BSTOCM_TSOPBFP_STAT =
- #{bstocmTsopbfpStat},
- </if>
- <if test="bstocmCpssStat != null and bstocmCpssStat != ''">BSTOCM_CPSS_STAT = #{bstocmCpssStat},</if>
- <if test="bstocmCmsStat != null and bstocmCmsStat != ''">BSTOCM_CMS_STAT = #{bstocmCmsStat},</if>
- <if test="raiobisStat != null and raiobisStat != ''">RAIOBIS_STAT = #{raiobisStat},</if>
- <if test="biofuamStat != null and biofuamStat != ''">BIOFUAM_STAT = #{biofuamStat},</if>
- <if test="bitopqQmsStat != null and bitopqQmsStat != ''">BITOPQ_QMS_STAT = #{bitopqQmsStat},</if>
- <if test="bitopqPeqaaStat != null and bitopqPeqaaStat != ''">BITOPQ_PEQAA_STAT = #{bitopqPeqaaStat},</if>
- <if test="bioesPeStat != null and bioesPeStat != ''">BIOES_PE_STAT = #{bioesPeStat},</if>
- <if test="bioesRwunitStat != null and bioesRwunitStat != ''">BIOES_RWUNIT_STAT = #{bioesRwunitStat},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="province != null and province">PROVINCE = #{province},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpRgstr">
- update TAC_PAWP_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="isPoverty != null">IS_POVERTY = #{isPoverty},</if>
- <if test="adName != null">AD_NAME = #{adName},</if>
- <if test="admOrg != null">ADM_ORG = #{admOrg},</if>
- <if test="adCode != null">AD_CODE = #{adCode},</if>
- <if test="location != null">LOCATION = #{location},</if>
- <if test="type != null">TYPE = #{type},</if>
- <if test="itmeDesc != null">ITME_DESC = #{itmeDesc},</if>
- <if test="itmeEval != null">ITME_EVAL = #{itmeEval},</if>
- <if test="katalog != null">KATALOG = #{katalog},</if>
- <if test="spcltYm != null">SPCLT_YM = #{spcltYm},</if>
- <if test="revOpin != null">REV_OPIN = #{revOpin},</if>
- <if test="revTm != null">REV_TM = #{revTm},</if>
- <if test="centerX != null">CENTER_X = #{centerX},</if>
- <if test="centerY != null">CENTER_Y = #{centerY},</if>
- <if test="gdX != null">GD_X = #{gdX},</if>
- <if test="gdY != null">GD_Y = #{gdY},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="pdbstStat != null and pdbstStat != ''">PDBST_STAT = #{pdbstStat},</if>
- <if test="bstocmPlprsStat != null and bstocmPlprsStat != ''">BSTOCM_PLPRS_STAT = #{bstocmPlprsStat},</if>
- <if test="bstocmTsopbfpStat != null and bstocmTsopbfpStat != ''">BSTOCM_TSOPBFP_STAT =
- #{bstocmTsopbfpStat},
- </if>
- <if test="bstocmCpssStat != null and bstocmCpssStat != ''">BSTOCM_CPSS_STAT = #{bstocmCpssStat},</if>
- <if test="bstocmCmsStat != null and bstocmCmsStat != ''">BSTOCM_CMS_STAT = #{bstocmCmsStat},</if>
- <if test="raiobisStat != null and raiobisStat != ''">RAIOBIS_STAT = #{raiobisStat},</if>
- <if test="biofuamStat != null and biofuamStat != ''">BIOFUAM_STAT = #{biofuamStat},</if>
- <if test="bitopqQmsStat != null and bitopqQmsStat != ''">BITOPQ_QMS_STAT = #{bitopqQmsStat},</if>
- <if test="bitopqPeqaaStat != null and bitopqPeqaaStat != ''">BITOPQ_PEQAA_STAT = #{bitopqPeqaaStat},</if>
- <if test="bioesPeStat != null and bioesPeStat != ''">BIOES_PE_STAT = #{bioesPeStat},</if>
- <if test="bioesRwunitStat != null and bioesRwunitStat != ''">BIOES_RWUNIT_STAT = #{bioesRwunitStat},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="province != null and province">PROVINCE = #{province},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!--获取稽察项目督查任务列表-->
- <select id="findPawpPage" parameterType="cn.com.goldenwater.dcproj.param.TypeParam"
- resultType="cn.com.goldenwater.dcproj.dto.TacPawpRgstrDto">
- SELECT *
- FROM (SELECT A.CODE,
- (CASE
- WHEN R.NAME IS NULL THEN
- A.NM
- ELSE
- R.NAME
- END) NM,
- A.ID,
- A.PTYPE,
- A.LGTD,
- A.LTTD,
- A.OBJ_INTM,
- A.OBJ_ID,
- A.IS_SET_OBJ,
- CASE
- WHEN R.STATE IS NULL THEN
- '0'
- ELSE
- R.STATE
- END AS WTDSTSTATE,
- (CASE
- WHEN R.LOCATION IS NULL THEN
- E.LOCATION
- ELSE
- R.LOCATION
- END) AS LOCATION,
- (CASE
- WHEN R.Adm_Org IS NULL THEN
- E.Adm_Org
- ELSE
- R.Adm_Org
- END) AS Adm_Org,
- R.AD_CODE,
- R.TYPE,
- R.NAME,
- R.CENTER_X,
- R.CENTER_Y,
- R.GD_X,
- R.GD_Y,
- R.PDBST_STAT,
- R.BSTOCM_PLPRS_STAT,
- R.BSTOCM_TSOPBFP_STAT,
- R.BSTOCM_CPSS_STAT,
- R.BSTOCM_CMS_STAT,
- R.RAIOBIS_STAT,
- R.BIOFUAM_STAT,
- R.BITOPQ_QMS_STAT,
- R.BITOPQ_PEQAA_STAT,
- R.BIOES_PE_STAT,
- R.BIOES_RWUNIT_STAT,
- R.ID AS RGSTRID,
- R.GROUP_ID,
- R.PROVINCE,
- R.INTM,
- R.AD_NAME,
- R.IS_POVERTY
- FROM BIS_INSP_ALL_OBJ A
- LEFT JOIN TAC_PAWP_RGSTR R
- ON A.OBJ_ID = R.OBJ_ID
- LEFT JOIN TAC_ATT_PAWP_BASE E
- ON A.CODE = E.ID
- WHERE A.PTYPE = '8' and
- A.id in (${inIdsSql})) a where 1=1
- <include refid="choseSqlR"/>
- <if test="plnaId !=null and plnaId !=''">
- and a.id like '${plnaId}%'
- </if>
- <if test="rsName !=null and rsName !=''">
- and a.nm like '${rsName}%'
- </if>
- <if test="state !=null and state !=''">
- and wtdstState =#{state}
- </if>
- <if test="code !=null and code !=''">
- and code like '${code}%'
- </if>
- order by wtdstState asc
- <if test="orderBy != null and orderBy != ''">
- <!-- ,${orderBy}-->
- ,CONVERT( nm USING gbk ) COLLATE gbk_chinese_ci ASC
- </if>
- </select>
- <sql id="choseSqlR" >
- <choose>
- <when test="province !=null and province !=''">
- and a.province=#{province}
- </when>
- <otherwise>
- and a.province is null
- </otherwise>
- </choose>
- </sql>
- <!--根据批次Id 获取下面的所有督查项目 -->
- <select id="getRgstrListByBatch" resultType="cn.com.goldenwater.dcproj.model.TacPawpRgstr">
- select B.* from TAC_INSP_YEAR_BATCH_OBJ A
- JOIN TAC_PAWP_RGSTR B ON A.ID=B.OBJ_ID
- WHERE B.STATE=#{state} and a.year=#{year} and A.BATCH=#{batch} and b.ad_code like '${orgId}%'
- </select>
- </mapper>
|