| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <?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.BisInspRsvrPblmMendDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRsvrPblmMend" id="bisInspRsvrPblmMendResultMap">
- <result property="id" column="ID" />
- <result property="year" column="YEAR" />
- <result property="mnth" column="MNTH" />
- <result property="rgstrId" column="RGSTR_ID" />
- <result property="rsCode" column="RS_CODE" />
- <result property="rsName" column="RS_NAME" />
- <result property="adCode" column="AD_CODE" />
- <result property="proName" column="PRO_NAME" />
- <result property="cityName" column="CITY_NAME" />
- <result property="countyName" column="COUNTY_NAME" />
- <result property="damRegCode" column="DAM_REG_CODE" />
- <result property="engScal" column="ENG_SCAL" />
- <result property="safeComment" column="SAFE_COMMENT" />
- <result property="unit" column="UNIT" />
- <result property="pblmType" column="PBLM_TYPE" />
- <result property="pblmOption" column="PBLM_OPTION" />
- <result property="pblmDesc" column="PBLM_DESC" />
- <result property="pblmLevl" column="PBLM_LEVL" />
- <result property="attach" column="ATTACH" />
- <result property="pblmSn" column="PBLM_SN" />
- <result property="rectConc" column="RECT_CONC" />
- <result property="rectMsrs" column="RECT_MSRS" />
- <result property="revwInfo" column="REVW_INFO" />
- <result property="intm" column="INTM" />
- <result property="uptm" column="UPTM" />
- <result property="revwRectConc" column="REVW_RECT_CONC"/>
- <result property="realPlanDt" column="REAL_PLAN_DT"/>
- <result property="revwRectPblm" column="REVW_RECT_PBLM"/>
- <result property="revwState" column="REVW_STATE"/>
- <result property="auditConc" column="AUDIT_CONC"/>
- <result property="auditNote" column="AUDIT_NOTE"/>
- <result property="column1" column="COLUMN1"/>
- <result property="column2" column="COLUMN2"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- YEAR,
- MNTH,
- RGSTR_ID,
- RS_CODE,
- RS_NAME,
- AD_CODE,
- PRO_NAME,
- CITY_NAME,
- COUNTY_NAME,
- DAM_REG_CODE,
- ENG_SCAL,
- SAFE_COMMENT,
- UNIT,
- PBLM_TYPE,
- PBLM_OPTION,
- PBLM_DESC,
- PBLM_LEVL,
- ATTACH,
- PBLM_SN,
- RECT_CONC,
- RECT_MSRS,
- REVW_INFO,
- INTM,
- UPTM,
- REVW_RECT_CONC,
- REAL_PLAN_DT,
- REVW_RECT_PBLM,
- REVW_STATE,
- AUDIT_CONC,
- AUDIT_NOTE,
- COLUMN1,
- COLUMN2
- </sql>
- <sql id="entity_properties">
- #{id},
- #{year},
- #{mnth},
- #{rgstrId},
- #{rsCode},
- #{rsName},
- #{adCode},
- #{proName},
- #{cityName},
- #{countyName},
- #{damRegCode},
- #{engScal},
- #{safeComment},
- #{unit},
- #{pblmType},
- #{pblmOption},
- #{pblmDesc},
- #{pblmLevl},
- #{attach},
- #{pblmSn},
- #{rectConc},
- #{rectMsrs},
- #{revwInfo},
- #{intm},
- #{uptm},
- #{revwRectConc},
- #{realPlanDt},
- #{revwRectPblm},
- #{revwState},
- #{auditConc},
- #{auditNote},
- #{column1},
- #{column2}
- </sql>
- <sql id="table_columns_batch">
- ID,
- YEAR,
- MNTH,
- RGSTR_ID,
- RS_CODE,
- RS_NAME,
- AD_CODE,
- PRO_NAME,
- CITY_NAME,
- COUNTY_NAME,
- DAM_REG_CODE,
- ENG_SCAL,
- SAFE_COMMENT,
- UNIT,
- PBLM_TYPE,
- PBLM_OPTION,
- PBLM_DESC,
- PBLM_LEVL,
- ATTACH,
- PBLM_SN,
- RECT_CONC,
- RECT_MSRS,
- REVW_INFO,
- AUDIT_CONC,
- AUDIT_NOTE
- </sql>
- <sql id="entity_properties_batch">
- #{item.id},
- #{item.year},
- #{item.mnth},
- #{item.rgstrId},
- #{item.rsCode},
- #{item.rsName},
- #{item.adCode},
- #{item.proName},
- #{item.cityName},
- #{item.countyName},
- #{item.damRegCode},
- #{item.engScal},
- #{item.safeComment},
- #{item.unit},
- #{item.pblmType},
- #{item.pblmOption},
- #{item.pblmDesc},
- #{item.pblmLevl},
- #{item.attach},
- #{item.pblmSn},
- #{item.rectConc},
- #{item.rectMsrs},
- #{item.revwInfo},
- #{item.auditConc},
- #{item.auditNote}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="year != null and year != ''">and YEAR = #{year}</if>
- <if test="mnth != null and mnth != ''">and MNTH = #{mnth}</if>
- <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
- <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
- <if test="rsName != null and rsName != ''">and RS_NAME = #{rsName}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="proName != null and proName != ''">and PRO_NAME = #{proName}</if>
- <if test="cityName != null and cityName != ''">and CITY_NAME = #{cityName}</if>
- <if test="countyName != null and countyName != ''">and COUNTY_NAME = #{countyName}</if>
- <if test="damRegCode != null and damRegCode != ''">and DAM_REG_CODE = #{damRegCode}</if>
- <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
- <if test="safeComment != null and safeComment != ''">and SAFE_COMMENT = #{safeComment}</if>
- <if test="unit != null and unit != ''">and UNIT = #{unit}</if>
- <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
- <if test="pblmOption != null and pblmOption != ''">and PBLM_OPTION = #{pblmOption}</if>
- <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
- <if test="pblmLevl != null and pblmLevl != ''">and PBLM_LEVL = #{pblmLevl}</if>
- <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
- <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
- <if test="rectConc != null and rectConc != ''">and RECT_CONC = #{rectConc}</if>
- <if test="rectMsrs != null and rectMsrs != ''">and RECT_MSRS = #{rectMsrs}</if>
- <if test="revwInfo != null and revwInfo != ''">and REVW_INFO = #{revwInfo}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="revwRectConc != null">and REVW_RECT_CONC = #{revwRectConc}</if>
- <if test="realPlanDt != null">and REAL_PLAN_DT = #{realPlanDt}</if>
- <if test="revwRectPblm != null and revwRectPblm != ''">and REVW_RECT_PBLM = #{revwRectPblm}</if>
- <if test="revwState != null and revwState != ''">and REVW_STATE = #{revwState}</if>
- <if test="auditConc != null and auditConc != ''">and AUDIT_CONC = #{auditConc}</if>
- <if test="auditNote != null and auditNote != ''">and AUDIT_NOTE = #{auditNote}</if>
- <if test="column1 != null and column1 != ''">and COLUMN1 = #{column1}</if>
- <if test="column2 != null and column2 != ''">and COLUMN2 = #{column2}</if>
- and to_char(intm,'yyyy')=to_char(sysdate,'yyyy')
- </trim>
- </sql>
- <select id="get" resultMap="bisInspRsvrPblmMendResultMap" parameterType="String" >
- select <include refid="table_columns" /> from BIS_INSP_RSVR_PBLM_MEND where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspRsvrPblmMendResultMap">
- select <include refid="table_columns" /> from BIS_INSP_RSVR_PBLM_MEND <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="bisInspRsvrPblmMendResultMap">
- select <include refid="table_columns" /> from BIS_INSP_RSVR_PBLM_MEND
- </select>
- <select id="findList" resultMap="bisInspRsvrPblmMendResultMap">
- select <include refid="table_columns" /> from BIS_INSP_RSVR_PBLM_MEND <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from BIS_INSP_RSVR_PBLM_MEND <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrPblmMend">
- insert into BIS_INSP_RSVR_PBLM_MEND( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_RSVR_PBLM_MEND where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrPblmMend">
- delete from BIS_INSP_RSVR_PBLM_MEND <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_RSVR_PBLM_MEND set flag_valid = 0 where>ID = #{id}
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrPblmMend">
- update BIS_INSP_RSVR_PBLM_MEND
- <trim prefix="set" suffixOverrides=",">
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
- <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
- <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="safeComment != null and safeComment != ''">SAFE_COMMENT = #{safeComment},</if>
- <if test="unit != null and unit != ''">UNIT = #{unit},</if>
- <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
- <if test="pblmOption != null and pblmOption != ''">PBLM_OPTION = #{pblmOption},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="pblmLevl != null and pblmLevl != ''">PBLM_LEVL = #{pblmLevl},</if>
- <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- <if test="rectConc != null and rectConc != ''">RECT_CONC = #{rectConc},</if>
- <if test="rectMsrs != null and rectMsrs != ''">RECT_MSRS = #{rectMsrs},</if>
- <if test="revwInfo != null and revwInfo != ''">REVW_INFO = #{revwInfo},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="revwRectConc != null">REVW_RECT_CONC = #{revwRectConc},</if>
- <if test="realPlanDt != null">REAL_PLAN_DT = #{realPlanDt},</if>
- <if test="revwRectPblm != null and revwRectPblm != ''">REVW_RECT_PBLM = #{revwRectPblm},</if>
- <if test="revwState != null and revwState != ''">REVW_STATE = #{revwState},</if>
- <if test="auditConc != null and auditConc != ''">AUDIT_CONC = #{auditConc},</if>
- <if test="auditNote != null and auditNote != ''">AUDIT_NOTE = #{auditNote},</if>
- <if test="column1 != null and column1 != ''">COLUMN1 = #{column1},</if>
- <if test="column2 != null and column2 != ''">COLUMN2 = #{column2},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrPblmMend">
- update BIS_INSP_RSVR_PBLM_MEND
- <include refid="updateParam"/>
- <where>ID = #{id}</where>
- </update>
- <sql id="updateParamMwrBatch">
- <trim prefix="set" suffixOverrides=",">
- <if test="item.rectConc != null and item.rectConc != ''">RECT_CONC = #{item.rectConc},</if>
- <if test="item.rectMsrs != null and item.rectMsrs != ''">RECT_MSRS = #{item.rectMsrs},</if>
- <if test="item.revwInfo != null and item.revwInfo != ''">REVW_INFO = #{item.revwInfo},</if>
- <if test="item.auditConc != null and item.auditConc != ''">AUDIT_CONC = #{item.auditConc},</if>
- <if test="item.auditNote != null and item.auditNote != ''">AUDIT_NOTE = #{item.auditNote},</if>
- </trim>
- </sql>
- <sql id="updateParamMwr">
- <trim prefix="set" suffixOverrides=",">
- <if test="rectConc != null and rectConc != ''">RECT_CONC = #{rectConc},</if>
- <if test="rectMsrs != null and rectMsrs != ''">RECT_MSRS = #{rectMsrs},</if>
- <if test="revwInfo != null and revwInfo != ''">REVW_INFO = #{revwInfo},</if>
- <if test="auditConc != null and auditConc != ''">AUDIT_CONC = #{auditConc},</if>
- <if test="auditNote != null and auditNote != ''">AUDIT_NOTE = #{auditNote},</if>
- </trim>
- </sql>
- <sql id="updateParam">
- <trim prefix="set" suffixOverrides=",">
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
- <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
- <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
- <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="safeComment != null and safeComment != ''">SAFE_COMMENT = #{safeComment},</if>
- <if test="unit != null and unit != ''">UNIT = #{unit},</if>
- <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
- <if test="pblmOption != null and pblmOption != ''">PBLM_OPTION = #{pblmOption},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="pblmLevl != null and pblmLevl != ''">PBLM_LEVL = #{pblmLevl},</if>
- <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- <if test="rectConc != null and rectConc != ''">RECT_CONC = #{rectConc},</if>
- <if test="rectMsrs != null and rectMsrs != ''">RECT_MSRS = #{rectMsrs},</if>
- <if test="revwInfo != null and revwInfo != ''">REVW_INFO = #{revwInfo},</if>
- <if test="isRect != null and isRect != ''">IS_RECT = #{isRect},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="revwRectConc != null">REVW_RECT_CONC = #{revwRectConc},</if>
- <if test="realPlanDt != null">REAL_PLAN_DT = #{realPlanDt},</if>
- <if test="revwRectPblm != null and revwRectPblm != ''">REVW_RECT_PBLM = #{revwRectPblm},</if>
- <if test="revwState != null and revwState != ''">REVW_STATE = #{revwState},</if>
- <if test="auditConc != null and auditConc != ''">AUDIT_CONC = #{auditConc},</if>
- <if test="auditNote != null and auditNote != ''">AUDIT_NOTE = #{auditNote},</if>
- <if test="column1 != null and column1 != ''">COLUMN1 = #{column1},</if>
- <if test="column2 != null and column2 != ''">COLUMN2 = #{column2},</if>
- </trim>
- </sql>
- <!-- 其他自定义SQL -->
- <insert id="insertRsvrBatch" parameterType="java.util.Map">
- <foreach collection="bisInspRsvrPblmMends" separator=";" item="item">
- merge into BIS_INSP_RSVR_PBLM_MEND a
- using ( select #{item.id} as id from dual) b
- on (a.id=b.id)
- when matched then
- update
- <include refid="updateParamMwrBatch"/>
- when not matched then
- insert (<include refid="table_columns_batch" />)
- VALUES (<include refid="entity_properties_batch" />)
- </foreach>
- </insert>
- <insert id="insertRsvr" parameterType="java.util.Map">
- merge into BIS_INSP_RSVR_PBLM_MEND a
- using ( select #{id} as id from dual) b
- on (a.id=b.id)
- when matched then
- update
- <include refid="updateParamMwr"/>
- when not matched then
- insert (<include refid="table_columns" />)
- VALUES (<include refid="entity_properties" />)
- </insert>
- <select id="findRsvrPblmList" resultMap="bisInspRsvrPblmMendResultMap" parameterType="cn.com.goldenwater.dcproj.param.BisInspRsvrPblmMendParam">
- SELECT t.* FROM BIS_INSP_RSVR_PBLM_MEND t LEFT JOIN ATT_AD_X_BASE b ON t.ad_code = b.AD_CODE
- WHERE 1=1 and to_char(t.intm,'yyyy')=to_char(sysdate,'yyyy')
- <if test="year != null and year != ''">
- AND t.YEAR = #{year}
- </if>
- <if test="mnth != null and mnth != ''">
- AND t.MNTH = #{mnth}
- </if>
- <if test="adCode != null and adCode != ''">
- AND t.AD_CODE like CONCAT(#{adCode},'%')
- </if>
- <if test="relCode != null and relCode != ''">
- AND t.AD_CODE like CONCAT(#{relCode},'%')
- </if>
- <if test="rsName != null and rsName != ''">
- AND t.RS_NAME like CONCAT('%',CONCAT(#{rsName},'%'))
- </if>
- <if test="pblmType != null and pblmType != ''">
- AND t.PBLM_TYPE like CONCAT('%',CONCAT(#{pblmType},'%'))
- </if>
- <if test="pblmOption != null and pblmOption != ''">
- AND t.PBLM_OPTION like CONCAT('%',CONCAT(#{pblmOption},'%'))
- </if>
- <if test="pblmLevl != null and pblmLevl != ''">
- AND t.PBLM_LEVL = #{pblmLevl}
- </if>
- <if test="rectConc != null and rectConc != ''">
- AND t.RECT_CONC = #{rectConc}
- </if>
- <if test="adName != null and adName != ''">
- AND b.AD_FULL_NAME like concat('%',concat(#{adName},'%'))
- </if>
- <if test="startTime !=null and startTime !=''">
- AND t.intm >= TO_DATE(#{startTime},'YYYY-MM-DD HH24:mi:ss')
- </if>
- <if test="endTime !=null and endTime !=''">
- AND t.intm <= TO_DATE(#{endTime},'YYYY-MM-DD HH24:mi:ss')
- </if>
- </select>
- <update id="updateRevwInfo">
- update BIS_INSP_RSVR_PBLM_MEND set REVW_INFO = #{revwInfo} where ID = #{id}
- </update>
- </mapper>
|