| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <?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.WrGwsBDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.WrGwsB" id="wrGwsBResultMap">
- <result property="lgtd" column="LGTD"/>
- <result property="lttd" column="LTTD"/>
- <result property="lgtdpc" column="LGTDPC"/>
- <result property="lttdpc" column="LTTDPC"/>
- <result property="gwsCd" column="GWS_CD"/>
- <result property="gwsNm" column="GWS_NM"/>
- <result property="gwsA" column="GWS_A"/>
- <result property="rangDesc" column="RANG_DESC"/>
- <result property="wqGoal" column="WQ_GOAL"/>
- <result property="consCond" column="CONS_COND"/>
- <result property="putProdTm" column="PUT_PROD_TM"/>
- <result property="runCond" column="RUN_COND"/>
- <result property="avgExpYd" column="AVG_EXP_YD"/>
- <result property="wsObj" column="WS_OBJ"/>
- <result property="desInt" column="DES_INT"/>
- <result property="permInt" column="PERM_INT"/>
- <result property="whsManCd" column="WHS_MAN_CD"/>
- <result property="whsApprCd" column="WHS_APPR_CD"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="ts" column="TS"/>
- <result property="nt" column="NT"/>
- <result property="reportFrquency" column="REPORT_FRQUENCY"/>
- <result property="isuse" column="ISUSE"/>
- <result property="monG" column="MON_G"/>
- <result property="isEmg" column="IS_EMG"/>
- </resultMap>
- <sql id="table_columns">
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- GWS_CD ,
- GWS_NM ,
- GWS_A ,
- RANG_DESC ,
- WQ_GOAL ,
- CONS_COND ,
- DATE_FORMAT(PUT_PROD_TM,'%Y-%m-%d %T') PUT_PROD_TM,
- RUN_COND ,
- AVG_EXP_YD ,
- WS_OBJ ,
- DES_INT ,
- PERM_INT ,
- WHS_MAN_CD ,
- WHS_APPR_CD ,
- DATE_FORMAT(TS,'%Y-%m-%d %T') TS,
- NT ,
- REPORT_FRQUENCY ,
- ISUSE ,
- MON_G ,
- IS_EMG ,AD_CODE
- </sql>
- <sql id="table_columns2">
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- GWS_CD ,
- GWS_NM ,
- GWS_A ,
- RANG_DESC ,
- WQ_GOAL ,
- CONS_COND ,
- PUT_PROD_TM ,
- RUN_COND ,
- AVG_EXP_YD ,
- WS_OBJ ,
- DES_INT ,
- PERM_INT ,
- WHS_MAN_CD ,
- WHS_APPR_CD ,
- TS ,
- NT ,
- REPORT_FRQUENCY ,
- ISUSE ,
- MON_G ,
- IS_EMG ,AD_CODE
- </sql>
- <sql id="entity_properties">
- #{lgtd},
- #{lttd},
- #{lgtdpc},
- #{lttdpc},
- #{gwsCd},
- #{gwsNm},
- #{gwsA},
- #{rangDesc},
- #{wqGoal},
- #{consCond},
- STR_TO_DATE(#{putProdTm},'%Y-%m-%d %T') ,
- #{runCond},
- #{avgExpYd},
- #{wsObj},
- #{desInt},
- #{permInt},
- #{whsManCd},
- #{whsApprCd},
- STR_TO_DATE(#{ts},'%Y-%m-%d %T') ,
- #{nt},
- #{reportFrquency},
- #{isuse},
- #{monG},
- #{isEmg},#{adCode}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
- <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
- <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC = #{lgtdpc}</if>
- <if test="lttdpc != null and lttdpc != ''">and LTTDPC = #{lttdpc}</if>
- <if test="gwsCd != null and gwsCd != ''">and GWS_CD LIKE CONCAT(#{gwsCd}, '%')</if>
- <if test="gwsNm != null and gwsNm != ''">and GWS_NM LIKE CONCAT('%', #{gwsNm}, '%')</if>
- <if test="gwsA != null and gwsA != ''">and GWS_A = #{gwsA}</if>
- <if test="rangDesc != null and rangDesc != ''">and RANG_DESC = #{rangDesc}</if>
- <if test="wqGoal != null and wqGoal != ''">and WQ_GOAL = #{wqGoal}</if>
- <if test="consCond != null and consCond != ''">and CONS_COND = #{consCond}</if>
- <if test="putProdTm != null and putProdTm != ''">and PUT_PROD_TM = STR_TO_DATE(#{putProdTm},'%Y-%m-%d %T')
- </if>
- <if test="runCond != null and runCond != ''">and RUN_COND = #{runCond}</if>
- <if test="avgExpYd != null and avgExpYd != ''">and AVG_EXP_YD = #{avgExpYd}</if>
- <if test="wsObj != null and wsObj != ''">and WS_OBJ = #{wsObj}</if>
- <if test="desInt != null and desInt != ''">and DES_INT = #{desInt}</if>
- <if test="permInt != null and permInt != ''">and PERM_INT = #{permInt}</if>
- <if test="whsManCd != null and whsManCd != ''">and WHS_MAN_CD = #{whsManCd}</if>
- <if test="whsApprCd != null and whsApprCd != ''">and WHS_APPR_CD = #{whsApprCd}</if>
- <if test="ts != null and ts != ''">and TS = STR_TO_DATE(#{ts},'%Y-%m-%d %T')</if>
- <if test="nt != null and nt != ''">and NT = #{nt}</if>
- <if test="reportFrquency != null and reportFrquency != ''">and REPORT_FRQUENCY = #{reportFrquency}</if>
- <if test="isuse != null and isuse != ''">and ISUSE = #{isuse}</if>
- <if test="monG != null and monG != ''">and MON_G = #{monG}</if>
- <if test="isEmg != null and isEmg != ''">and IS_EMG = #{isEmg}</if>
- <if test="adCode != null and adCode != ''">and ad_Code like '${adCode}%'</if>
- </trim>
- </sql>
- <select id="get" resultMap="wrGwsBResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from WR_GWS_B where GWS_CD = #{id}
- </select>
- <select id="getBy" resultMap="wrGwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_GWS_B
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="wrGwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_GWS_B
- </select>
- <select id="findList" resultMap="wrGwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_GWS_B
- <include refid="page_where"/>
- order by GWS_CD
- </select>
- <select id="selectCount" resultType="int">
- select count(GWS_CD) from WR_GWS_B
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.WrGwsB">
- insert into WR_GWS_B(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from WR_GWS_B where GWS_CD = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.WrGwsB">
- delete from WR_GWS_B
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update WR_GWS_B set flag_valid = 0 where GWS_CD = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.WrGwsB">
- update WR_GWS_B
- <trim prefix="set" suffixOverrides=",">
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
- <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
- <if test="gwsNm != null and gwsNm != ''">GWS_NM = #{gwsNm},</if>
- <if test="gwsA != null and gwsA != ''">GWS_A = #{gwsA},</if>
- <if test="rangDesc != null and rangDesc != ''">RANG_DESC = #{rangDesc},</if>
- <if test="wqGoal != null and wqGoal != ''">WQ_GOAL = #{wqGoal},</if>
- <if test="consCond != null and consCond != ''">CONS_COND = #{consCond},</if>
- <if test="putProdTm != null and putProdTm != ''">PUT_PROD_TM = STR_TO_DATE(#{putProdTm},'%Y-%m-%d %T'),
- </if>
- <if test="runCond != null and runCond != ''">RUN_COND = #{runCond},</if>
- <if test="avgExpYd != null and avgExpYd != ''">AVG_EXP_YD = #{avgExpYd},</if>
- <if test="wsObj != null and wsObj != ''">WS_OBJ = #{wsObj},</if>
- <if test="desInt != null and desInt != ''">DES_INT = #{desInt},</if>
- <if test="permInt != null and permInt != ''">PERM_INT = #{permInt},</if>
- <if test="whsManCd != null and whsManCd != ''">WHS_MAN_CD = #{whsManCd},</if>
- <if test="whsApprCd != null and whsApprCd != ''">WHS_APPR_CD = #{whsApprCd},</if>
- <if test="ts != null and ts != ''">TS = STR_TO_DATE(#{ts},'%Y-%m-%d %T'),</if>
- <if test="nt != null and nt != ''">NT = #{nt},</if>
- <if test="reportFrquency != null and reportFrquency != ''">REPORT_FRQUENCY = #{reportFrquency},</if>
- <if test="isuse != null and isuse != ''">ISUSE = #{isuse},</if>
- <if test="monG != null and monG != ''">MON_G = #{monG},</if>
- <if test="isEmg != null and isEmg != ''">IS_EMG = #{isEmg},</if>
- <if test="adCode != null and adCode != ''">ad_Code = #{adCode},</if>
- </trim>
- <where>GWS_CD = #{gwsCd}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.WrGwsB">
- update WR_GWS_B
- <trim prefix="set" suffixOverrides=",">
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
- <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
- <if test="gwsCd != null and gwsCd != ''">GWS_CD = #{gwsCd},</if>
- <if test="gwsNm != null and gwsNm != ''">GWS_NM = #{gwsNm},</if>
- <if test="gwsA != null and gwsA != ''">GWS_A = #{gwsA},</if>
- <if test="rangDesc != null and rangDesc != ''">RANG_DESC = #{rangDesc},</if>
- <if test="wqGoal != null and wqGoal != ''">WQ_GOAL = #{wqGoal},</if>
- <if test="consCond != null and consCond != ''">CONS_COND = #{consCond},</if>
- <if test="putProdTm != null and putProdTm != ''">PUT_PROD_TM = STR_TO_DATE(#{putProdTm},'%Y-%m-%d %T'),
- </if>
- <if test="runCond != null and runCond != ''">RUN_COND = #{runCond},</if>
- <if test="avgExpYd != null and avgExpYd != ''">AVG_EXP_YD = #{avgExpYd},</if>
- <if test="wsObj != null and wsObj != ''">WS_OBJ = #{wsObj},</if>
- <if test="desInt != null and desInt != ''">DES_INT = #{desInt},</if>
- <if test="permInt != null and permInt != ''">PERM_INT = #{permInt},</if>
- <if test="whsManCd != null and whsManCd != ''">WHS_MAN_CD = #{whsManCd},</if>
- <if test="whsApprCd != null and whsApprCd != ''">WHS_APPR_CD = #{whsApprCd},</if>
- <if test="ts != null and ts != ''">TS = STR_TO_DATE(#{ts},'%Y-%m-%d %T'),</if>
- <if test="nt != null and nt != ''">NT = #{nt},</if>
- <if test="reportFrquency != null and reportFrquency != ''">REPORT_FRQUENCY = #{reportFrquency},</if>
- <if test="isuse != null and isuse != ''">ISUSE = #{isuse},</if>
- <if test="monG != null and monG != ''">MON_G = #{monG},</if>
- <if test="isEmg != null and isEmg != ''">IS_EMG = #{isEmg},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getMaxGwsCode" resultType="string" parameterType="string">
- SELECT MAX(GWS_CD) FROM WR_GWS_B WHERE GWS_CD LIKE CONCAT(#{adCode}, '%')
- </select>
- </mapper>
|