| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <?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.AttHystBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttHystBase" id="attHystBaseResultMap">
- <result property="id" column="ID"/>
- <result property="statisCode" column="STATIS_CODE"/>
- <result property="hystName" column="HYST_NAME"/>
- <result property="linkMan" column="LINK_MAN"/>
- <result property="linkTel" column="LINK_TEL"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="hystSite" column="HYST_SITE"/>
- <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="hystLong" column="HYST_LONG"/>
- <result property="hystLat" column="HYST_LAT"/>
- <result property="hystGdX" column="HYST_GD_X"/>
- <result property="hystGdY" column="HYST_GD_Y"/>
- <result property="rvName" column="RV_NAME"/>
- <result property="compDate" column="COMP_DATE"/>
- <result property="ownerType" column="OWNER_TYPE"/>
- <result property="exptType" column="EXPT_TYPE"/>
- <result property="insCap" column="INS_CAP"/>
- <result property="damHeig" column="DAM_HEIG"/>
- <result property="totCap" column="TOT_CAP"/>
- <result property="hystIsReg" column="HYST_IS_REG"/>
- <result property="regNo" column="REG_NO"/>
- <result property="isSafety" column="IS_SAFETY"/>
- <result property="zlgyFlow" column="ZLGY_FLOW"/>
- <result property="exmnType" column="EXMN_TYPE"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="note" column="NOTE"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- STATIS_CODE,
- HYST_NAME,
- LINK_MAN,
- LINK_TEL,
- AD_CODE,
- AD_NAME,
- HYST_SITE,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- HYST_LONG,
- HYST_LAT,
- HYST_GD_X,
- HYST_GD_Y,
- RV_NAME,
- COMP_DATE,
- OWNER_TYPE,
- EXPT_TYPE,
- INS_CAP,
- DAM_HEIG,
- TOT_CAP,
- HYST_IS_REG,
- REG_NO,
- IS_SAFETY,
- ZLGY_FLOW,
- EXMN_TYPE,
- INTM,
- UPTM,
- NOTE
- </sql>
- <sql id="entity_properties">
- #{id},
- #{statisCode},
- #{hystName},
- #{linkMan},
- #{linkTel},
- #{adCode},
- #{adName},
- #{hystSite},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{hystLong},
- #{hystLat},
- #{hystGdX},
- #{hystGdY},
- #{rvName},
- #{compDate},
- #{ownerType},
- #{exptType},
- #{insCap},
- #{damHeig},
- #{totCap},
- #{hystIsReg},
- #{regNo},
- #{isSafety},
- #{zlgyFlow},
- #{exmnType},
- #{intm},
- #{uptm},
- #{note}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="hystName != null and hystName != ''">and HYST_NAME = #{hystName}</if>
- <if test="linkMan != null and linkMan != ''">and LINK_MAN = #{linkMan}</if>
- <if test="linkTel != null and linkTel != ''">and LINK_TEL = #{linkTel}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</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="hystLong != null and hystLong != ''">and HYST_LONG = #{hystLong}</if>
- <if test="hystLat != null and hystLat != ''">and HYST_LAT = #{hystLat}</if>
- <if test="hystGdX != null and hystGdX != ''">and HYST_GD_X = #{hystGdX}</if>
- <if test="hystGdY != null and hystGdY != ''">and HYST_GD_Y = #{hystGdY}</if>
- <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
- <if test="compDate != null and compDate != ''">and COMP_DATE = #{compDate}</if>
- <if test="ownerType != null and ownerType != ''">and OWNER_TYPE = #{ownerType}</if>
- <if test="exptType != null and exptType != ''">and EXPT_TYPE = #{exptType}</if>
- <if test="insCap != null and insCap != ''">and INS_CAP = #{insCap}</if>
- <if test="damHeig != null and damHeig != ''">and DAM_HEIG = #{damHeig}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- <if test="hystIsReg != null and hystIsReg != ''">and HYST_IS_REG = #{hystIsReg}</if>
- <if test="regNo != null and regNo != ''">and REG_NO = #{regNo}</if>
- <if test="isSafety != null and isSafety != ''">and IS_SAFETY = #{isSafety}</if>
- <if test="zlgyFlow != null and zlgyFlow != ''">and ZLGY_FLOW = #{zlgyFlow}</if>
- <if test="exmnType != null and exmnType != ''">and EXMN_TYPE = #{exmnType}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="statisCode != null and statisCode != ''">and STATIS_CODE = #{statisCode}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attHystBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_HYST_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attHystBaseResultMap">
- select <include refid="table_columns" /> from ATT_HYST_BASE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attHystBaseResultMap">
- select <include refid="table_columns" /> from ATT_HYST_BASE
- </select>
- <select id="findList" resultMap="attHystBaseResultMap">
- select <include refid="table_columns" /> from ATT_HYST_BASE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_HYST_BASE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- insert into ATT_HYST_BASE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_HYST_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- delete from ATT_HYST_BASE <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_HYST_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- update ATT_HYST_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="hystName != null and hystName != ''">HYST_NAME = #{hystName},</if>
- <if test="linkMan != null and linkMan != ''">LINK_MAN = #{linkMan},</if>
- <if test="linkTel != null and linkTel != ''">LINK_TEL = #{linkTel},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
- <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
- <if test="compDate != null and compDate != ''">COMP_DATE = #{compDate},</if>
- <if test="ownerType != null and ownerType != ''">OWNER_TYPE = #{ownerType},</if>
- <if test="exptType != null and exptType != ''">EXPT_TYPE = #{exptType},</if>
- <if test="insCap != null and insCap != ''">INS_CAP = #{insCap},</if>
- <if test="damHeig != null and damHeig != ''">DAM_HEIG = #{damHeig},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="hystIsReg != null and hystIsReg != ''">HYST_IS_REG = #{hystIsReg},</if>
- <if test="regNo != null and regNo != ''">REG_NO = #{regNo},</if>
- <if test="isSafety != null and isSafety != ''">IS_SAFETY = #{isSafety},</if>
- <if test="zlgyFlow != null and zlgyFlow != ''">ZLGY_FLOW = #{zlgyFlow},</if>
- <if test="exmnType != null and exmnType != ''">EXMN_TYPE = #{exmnType},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="statisCode != null and statisCode != ''">STATIS_CODE = #{statisCode},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- update ATT_HYST_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="hystName != null and hystName != ''">HYST_NAME = #{hystName},</if>
- <if test="linkMan != null and linkMan != ''">LINK_MAN = #{linkMan},</if>
- <if test="linkTel != null and linkTel != ''">LINK_TEL = #{linkTel},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
- <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
- <if test="compDate != null and compDate != ''">COMP_DATE = #{compDate},</if>
- <if test="ownerType != null and ownerType != ''">OWNER_TYPE = #{ownerType},</if>
- <if test="exptType != null and exptType != ''">EXPT_TYPE = #{exptType},</if>
- <if test="insCap != null and insCap != ''">INS_CAP = #{insCap},</if>
- <if test="damHeig != null and damHeig != ''">DAM_HEIG = #{damHeig},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="hystIsReg != null and hystIsReg != ''">HYST_IS_REG = #{hystIsReg},</if>
- <if test="regNo != null and regNo != ''">REG_NO = #{regNo},</if>
- <if test="isSafety != null and isSafety != ''">IS_SAFETY = #{isSafety},</if>
- <if test="zlgyFlow != null and zlgyFlow != ''">ZLGY_FLOW = #{zlgyFlow},</if>
- <if test="exmnType != null and exmnType != ''">EXMN_TYPE = #{exmnType},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="statisCode != null and statisCode != ''">STATIS_CODE = #{statisCode},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="findListByParam" resultMap="attHystBaseResultMap"
- parameterType="cn.com.goldenwater.dcproj.param.BisInspHystInfoParam">
- select
- C.ID, C.HYST_NAME, C.LINK_MAN, C.LINK_TEL, C.AD_CODE,
- C.AD_NAME, C.HYST_SITE, C.CENTER_X, C.CENTER_Y,C.GD_X,C.GD_Y, C.HYST_LONG,
- C.HYST_LAT,C.HYST_GD_X,C.HYST_GD_Y, C.RV_NAME, C.COMP_DATE, C.OWNER_TYPE, C.EXPT_TYPE,
- C.INS_CAP, C.DAM_HEIG, C.TOT_CAP, C.HYST_IS_REG, C.REG_NO,
- C.IS_SAFETY, C.ZLGY_FLOW, C.EXMN_TYPE, C.INTM, C.UPTM, C.NOTE
- from ATT_HYST_BASE C
- where C.id not in (select D.BASE_ID from BIS_INSP_HYST_INFO D
- where 1=1
- <if test="rgstrId != null and rgstrId != ''">and D.RGSTR_ID = #{rgstrId}</if>)
- <if test="hystName != null and hystName != ''">and C.HYST_NAME like concat('%',concat(#{hystName},'%'))</if>
- <if test="adCode != null and adCode != ''">and C.AD_CODE like concat(#{adCode},'%')</if>
- <if test="exmnType != null and exmnType != ''">and C.EXMN_TYPE = #{exmnType}</if>
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update ATT_HYST_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="item.centerX != null and item.centerX != ''">CENTER_X = #{item.centerX},</if>
- <if test="item.centerY != null and item.centerY != ''">CENTER_Y = #{item.centerY},</if>
- <if test="item.gdX != null and item.gdX != ''">GD_X = #{item.gdX},</if>
- <if test="item.gdY != null and item.gdY != ''">GD_Y = #{item.gdY},</if>
- <if test="item.hystLong != null and item.hystLong != ''">HYST_LONG = #{item.hystLong},</if>
- <if test="item.hystLat != null and item.hystLat != ''">HYST_LAT = #{item.hystLat},</if>
- <if test="item.hystGdX != null and item.hystGdX != ''">HYST_GD_X = #{item.hystGdX},</if>
- <if test="item.hystGdY != null and item.hystGdY != ''">HYST_GD_Y = #{item.hystGdY},</if>
- </trim>
- <where>ID = #{id}</where>
- </foreach>
- </update>
- <update id="updateGdXy" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- update ATT_HYST_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="hystLong != null and hystLong != ''">HYST_LONG = #{hystLong},</if>
- <if test="hystLat != null and hystLat != ''">HYST_LAT = #{hystLat},</if>
- <if test="hystGdX != null and hystGdX != ''">HYST_GD_X = #{hystGdX},</if>
- <if test="hystGdY != null and hystGdY != ''">HYST_GD_Y = #{hystGdY},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBase" parameterType="cn.com.goldenwater.dcproj.model.AttHystBase">
- update ATT_HYST_BASE set COMP_DATE = #{compDate} where hyst_name = #{hystName}
- <if test="statisCode != null and statisCode != ''">
- and STATIS_CODE = #{statisCode}
- </if>
- </update>
- <select id="findHystList" resultType="cn.com.goldenwater.dcproj.model.AttHystBase">
- select * from ATT_HYST_BASE t where HYST_GD_X is null
- </select>
- </mapper>
|