| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <?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.WrSwsBDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.WrSwsB" id="wrSwsBResultMap">
- <result property="lgtd" column="LGTD"/>
- <result property="lttd" column="LTTD"/>
- <result property="lgtdpc" column="LGTDPC"/>
- <result property="lttdpc" column="LTTDPC"/>
- <result property="swsCd" column="SWS_CD"/>
- <result property="swsNm" column="SWS_NM"/>
- <result property="swsTp" column="SWS_TP"/>
- <result property="watA" column="WAT_A"/>
- <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="wsCond" column="WS_COND"/>
- <result property="wsObj" column="WS_OBJ"/>
- <result property="dywsPp" column="DYWS_PP"/>
- <result property="dywsW" column="DYWS_W"/>
- <result property="ddwsW" column="DDWS_W"/>
- <result property="whsManCd" column="WHS_MAN_CD"/>
- <result property="whsApprCd" column="WHS_APPR_CD"/>
- <result property="emCd" column="EM_CD"/>
- <result property="ts" column="TS"/>
- <result property="nt" column="NT"/>
- <result property="monG" column="MON_G"/>
- <result property="repPer" column="REP_PER"/>
- <result property="isuse" column="ISUSE"/>
- <result property="firProA" column="FIR_PRO_A"/>
- <result property="secProA" column="SEC_PRO_A"/>
- <result property="norProA" column="NOR_PRO_A"/>
- <result property="isEmg" column="IS_EMG"/>
- </resultMap>
- <sql id="table_columns">
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- SWS_CD ,
- SWS_NM ,
- SWS_TP ,
- WAT_A ,
- WQ_GOAL ,
- CONS_COND ,
- TO_CHAR(PUT_PROD_TM,'YYYY-MM-DD HH24:MI:SS') PUT_PROD_TM,
- RUN_COND ,
- WS_COND ,
- WS_OBJ ,
- DYWS_PP ,
- DYWS_W ,
- DDWS_W ,
- WHS_MAN_CD ,
- WHS_APPR_CD ,
- EM_CD ,
- TO_CHAR(TS,'YYYY-MM-DD HH24:MI:SS') TS,
- NT ,
- MON_G ,
- REP_PER ,
- ISUSE ,
- FIR_PRO_A ,
- SEC_PRO_A ,
- NOR_PRO_A ,
- IS_EMG ,ad_Code
- </sql>
- <sql id="table_columns2">
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- SWS_CD ,
- SWS_NM ,
- SWS_TP ,
- WAT_A ,
- WQ_GOAL ,
- CONS_COND ,
- PUT_PROD_TM ,
- RUN_COND ,
- WS_COND ,
- WS_OBJ ,
- DYWS_PP ,
- DYWS_W ,
- DDWS_W ,
- WHS_MAN_CD ,
- WHS_APPR_CD ,
- EM_CD ,
- TS ,
- NT ,
- MON_G ,
- REP_PER ,
- ISUSE ,
- FIR_PRO_A ,
- SEC_PRO_A ,
- NOR_PRO_A ,
- IS_EMG
- </sql>
- <sql id="entity_properties">
- #{lgtd},
- #{lttd},
- #{lgtdpc},
- #{lttdpc},
- #{swsCd},
- #{swsNm},
- #{swsTp},
- #{watA},
- #{wqGoal},
- #{consCond},
- TO_DATE(#{putProdTm},'YYYY-MM-DD HH24:MI:SS') ,
- #{runCond},
- #{wsCond},
- #{wsObj},
- #{dywsPp},
- #{dywsW},
- #{ddwsW},
- #{whsManCd},
- #{whsApprCd},
- #{emCd},
- TO_DATE(#{ts},'YYYY-MM-DD HH24:MI:SS') ,
- #{nt},
- #{monG},
- #{repPer},
- #{isuse},
- #{firProA},
- #{secProA},
- #{norProA},
- #{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="swsCd != null and swsCd != ''">and SWS_CD LIKE #{swsCd}||'%'</if>
- <if test="swsNm != null and swsNm != ''">and SWS_NM LIKE '%'||#{swsNm}||'%'</if>
- <if test="swsTp != null and swsTp != ''">and SWS_TP = #{swsTp}</if>
- <if test="watA != null and watA != ''">and WAT_A = #{watA}</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 = TO_DATE(#{putProdTm},'YYYY-MM-DD
- HH24:MI:SS')
- </if>
- <if test="runCond != null and runCond != ''">and RUN_COND = #{runCond}</if>
- <if test="wsCond != null and wsCond != ''">and WS_COND = #{wsCond}</if>
- <if test="wsObj != null and wsObj != ''">and WS_OBJ = #{wsObj}</if>
- <if test="dywsPp != null and dywsPp != ''">and DYWS_PP = #{dywsPp}</if>
- <if test="dywsW != null and dywsW != ''">and DYWS_W = #{dywsW}</if>
- <if test="ddwsW != null and ddwsW != ''">and DDWS_W = #{ddwsW}</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="emCd != null and emCd != ''">and EM_CD = #{emCd}</if>
- <if test="ts != null and ts != ''">and TS = TO_DATE(#{ts},'YYYY-MM-DD HH24:MI:SS')</if>
- <if test="nt != null and nt != ''">and NT = #{nt}</if>
- <if test="monG != null and monG != ''">and MON_G = #{monG}</if>
- <if test="repPer != null and repPer != ''">and REP_PER = #{repPer}</if>
- <if test="isuse != null and isuse != ''">and ISUSE = #{isuse}</if>
- <if test="firProA != null and firProA != ''">and FIR_PRO_A = #{firProA}</if>
- <if test="secProA != null and secProA != ''">and SEC_PRO_A = #{secProA}</if>
- <if test="norProA != null and norProA != ''">and NOR_PRO_A = #{norProA}</if>
- <if test="isEmg != null and isEmg != ''">and IS_EMG = #{isEmg}</if>
- <if test="adCode != null and adCode != ''">and ad_Code like '${adCode}%'</if>
- <if test="province != null and province != ''">and sws_cd like '${province}%'</if>
- </trim>
- </sql>
- <select id="get" resultMap="wrSwsBResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from WR_SWS_B where SWS_CD = #{id}
- </select>
- <select id="getBy" resultMap="wrSwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_SWS_B
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="wrSwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_SWS_B
- </select>
- <select id="findList" resultMap="wrSwsBResultMap">
- select
- <include refid="table_columns"/>
- from WR_SWS_B
- <include refid="page_where"/>
- order by SWS_CD
- </select>
- <select id="selectCount" resultType="int">
- select count(SWS_CD) from WR_SWS_B
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.WrSwsB">
- insert into WR_SWS_B(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from WR_SWS_B where SWS_CD = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.WrSwsB">
- delete from WR_SWS_B
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update WR_SWS_B set flag_valid = 0 where SWS_CD = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.WrSwsB">
- update WR_SWS_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="swsNm != null and swsNm != ''">SWS_NM=#{swsNm},</if>
- <if test="swsTp != null and swsTp != ''">SWS_TP = #{swsTp},</if>
- <if test="watA != null and watA != ''">WAT_A = #{watA},</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 = TO_DATE(#{putProdTm},'YYYY-MM-DD
- HH24:MI:SS'),
- </if>
- <if test="runCond != null and runCond != ''">RUN_COND = #{runCond},</if>
- <if test="wsCond != null and wsCond != ''">WS_COND = #{wsCond},</if>
- <if test="wsObj != null and wsObj != ''">WS_OBJ = #{wsObj},</if>
- <if test="dywsPp != null and dywsPp != ''">DYWS_PP = #{dywsPp},</if>
- <if test="dywsW != null and dywsW != ''">DYWS_W = #{dywsW},</if>
- <if test="ddwsW != null and ddwsW != ''">DDWS_W = #{ddwsW},</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="emCd != null and emCd != ''">EM_CD = #{emCd},</if>
- <if test="ts != null and ts != ''">TS = TO_DATE(#{ts},'YYYY-MM-DD HH24:MI:SS'),</if>
- <if test="nt != null and nt != ''">NT = #{nt},</if>
- <if test="monG != null and monG != ''">MON_G = #{monG},</if>
- <if test="repPer != null and repPer != ''">REP_PER = #{repPer},</if>
- <if test="isuse != null and isuse != ''">ISUSE = #{isuse},</if>
- <if test="firProA != null and firProA != ''">FIR_PRO_A = #{firProA},</if>
- <if test="secProA != null and secProA != ''">SEC_PRO_A = #{secProA},</if>
- <if test="norProA != null and norProA != ''">NOR_PRO_A = #{norProA},</if>
- <if test="isEmg != null and isEmg != ''">IS_EMG = #{isEmg},</if>
- </trim>
- <where>SWS_CD = #{swsCd}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.WrSwsB">
- update WR_SWS_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="swsCd != null and swsCd != ''">SWS_CD = #{swsCd},</if>
- <if test="swsNm != null and swsNm != ''">SWS_NM = #{swsNm},</if>
- <if test="swsTp != null and swsTp != ''">SWS_TP = #{swsTp},</if>
- <if test="watA != null and watA != ''">WAT_A = #{watA},</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 = TO_DATE(#{putProdTm},'YYYY-MM-DD
- HH24:MI:SS'),
- </if>
- <if test="runCond != null and runCond != ''">RUN_COND = #{runCond},</if>
- <if test="wsCond != null and wsCond != ''">WS_COND = #{wsCond},</if>
- <if test="wsObj != null and wsObj != ''">WS_OBJ = #{wsObj},</if>
- <if test="dywsPp != null and dywsPp != ''">DYWS_PP = #{dywsPp},</if>
- <if test="dywsW != null and dywsW != ''">DYWS_W = #{dywsW},</if>
- <if test="ddwsW != null and ddwsW != ''">DDWS_W = #{ddwsW},</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="emCd != null and emCd != ''">EM_CD = #{emCd},</if>
- <if test="ts != null and ts != ''">TS = TO_DATE(#{ts},'YYYY-MM-DD HH24:MI:SS'),</if>
- <if test="nt != null and nt != ''">NT = #{nt},</if>
- <if test="monG != null and monG != ''">MON_G = #{monG},</if>
- <if test="repPer != null and repPer != ''">REP_PER = #{repPer},</if>
- <if test="isuse != null and isuse != ''">ISUSE = #{isuse},</if>
- <if test="firProA != null and firProA != ''">FIR_PRO_A = #{firProA},</if>
- <if test="secProA != null and secProA != ''">SEC_PRO_A = #{secProA},</if>
- <if test="norProA != null and norProA != ''">NOR_PRO_A = #{norProA},</if>
- <if test="isEmg != null and isEmg != ''">IS_EMG = #{isEmg},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getMaxCwsCode" resultType="string" parameterType="string">
- SELECT MAX(SWS_CD) FROM WR_SWS_B WHERE SWS_CD LIKE #{adCode}||'%'
- </select>
- </mapper>
|