| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <?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.AttIrrBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttIrrBase" id="attIrrBaseResultMap">
- <result property="id" column="ID"/>
- <result property="irrCode" column="IRR_CODE"/>
- <result property="irrName" column="IRR_NAME"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="location" column="LOCATION"/>
- <result property="centerXGd" column="CENTER_X_GD"/>
- <result property="centerYGd" column="CENTER_Y_GD"/>
- <result property="centerX" column="CENTER_X"/>
- <result property="centerY" column="CENTER_Y"/>
- <result property="lowLeftLong" column="LOW_LEFT_LONG"/>
- <result property="lowLeftLat" column="LOW_LEFT_LAT"/>
- <result property="upRightLong" column="UP_RIGHT_LONG"/>
- <result property="upRightLat" column="UP_RIGHT_LAT"/>
- <result property="src" column="SRC"/>
- <result property="irrRang" column="IRR_RANG"/>
- <result property="totIrrArea" column="TOT_IRR_AREA"/>
- <result property="effIrrArea" column="EFF_IRR_AREA"/>
- <result property="desIrrArea" column="DES_IRR_AREA"/>
- <result property="engStat" column="ENG_STAT"/>
- <result property="runStat" column="RUN_STAT"/>
- <result property="irrEngScal" column="IRR_ENG_SCAL"/>
- <result property="startDate" column="START_DATE"/>
- <result property="compDate" column="COMP_DATE"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="state" column="STATE"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- </resultMap>
- <sql id="table_columns">
- GD_X,
- GD_Y,
- ID,
- IRR_CODE,
- IRR_NAME,
- AD_CODE,
- AD_NAME,
- LOCATION,
- CENTER_X_GD,
- CENTER_Y_GD,
- CENTER_X,
- CENTER_Y,
- LOW_LEFT_LONG,
- LOW_LEFT_LAT,
- UP_RIGHT_LONG,
- UP_RIGHT_LAT,
- SRC,
- IRR_RANG,
- TOT_IRR_AREA,
- EFF_IRR_AREA,
- DES_IRR_AREA,
- ENG_STAT,
- RUN_STAT,
- IRR_ENG_SCAL,
- START_DATE,
- COMP_DATE,
- INTM,
- UPTM,
- DATA_STAT,
- STATE
- </sql>
- <sql id="entity_properties">
- #{gdX},
- #{gdY},
- #{id},
- #{irrCode},
- #{irrName},
- #{adCode},
- #{adName},
- #{location},
- #{centerXGd},
- #{centerYGd},
- #{centerX},
- #{centerY},
- #{lowLeftLong},
- #{lowLeftLat},
- #{upRightLong},
- #{upRightLat},
- #{src},
- #{irrRang},
- #{totIrrArea},
- #{effIrrArea},
- #{desIrrArea},
- #{engStat},
- #{runStat},
- #{irrEngScal},
- #{startDate},
- #{compDate},
- #{intm},
- #{uptm},
- #{dataStat},
- #{state}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
- <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
- <if test="irrCode != null and irrCode != ''">and IRR_CODE = #{irrCode}</if>
- <if test="irrName != null and irrName != ''">and IRR_NAME like '%${irrName}%'</if>
- <if test="adCode != null and adCode != ''">and AD_CODE like concat(#{adCode},'%')</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="location != null and location != ''">and LOCATION = #{location}</if>
- <if test="centerXGd != null and centerXGd != ''">and CENTER_X_GD = #{centerXGd}</if>
- <if test="centerYGd != null and centerYGd != ''">and CENTER_Y_GD = #{centerYGd}</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="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG = #{lowLeftLong}</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT = #{lowLeftLat}</if>
- <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG = #{upRightLong}</if>
- <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT = #{upRightLat}</if>
- <if test="src != null and src != ''">and SRC = #{src}</if>
- <if test="irrRang != null and irrRang != ''">and IRR_RANG = #{irrRang}</if>
- <if test="totIrrArea != null and totIrrArea != ''">and TOT_IRR_AREA = #{totIrrArea}</if>
- <if test="effIrrArea != null and effIrrArea != ''">and EFF_IRR_AREA = #{effIrrArea}</if>
- <if test="desIrrArea != null and desIrrArea != ''">and DES_IRR_AREA = #{desIrrArea}</if>
- <if test="engStat != null and engStat != ''">and ENG_STAT = #{engStat}</if>
- <if test="runStat != null and runStat != ''">and RUN_STAT = #{runStat}</if>
- <if test="irrEngScal != null and irrEngScal != ''">and IRR_ENG_SCAL = #{irrEngScal}</if>
- <if test="startDate != null">and START_DATE = #{startDate}</if>
- <if test="compDate != null">and COMP_DATE = #{compDate}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="attIrrBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_IRR_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attIrrBaseResultMap">
- select <include refid="table_columns" /> from ATT_IRR_BASE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attIrrBaseResultMap">
- select <include refid="table_columns" /> from ATT_IRR_BASE
- </select>
- <select id="findList" resultMap="attIrrBaseResultMap">
- select <include refid="table_columns" /> from ATT_IRR_BASE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_IRR_BASE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
- insert into ATT_IRR_BASE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update ATT_IRR_BASE set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
- update ATT_IRR_BASE set DATA_STAT='9' <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_IRR_BASE set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
- update ATT_IRR_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="irrCode != null and irrCode != ''">IRR_CODE = #{irrCode},</if>
- <if test="irrName != null and irrName != ''">IRR_NAME = #{irrName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="location != null and location != ''">LOCATION = #{location},</if>
- <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
- <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
- <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
- <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
- <if test="src != null and src != ''">SRC = #{src},</if>
- <if test="irrRang != null and irrRang != ''">IRR_RANG = #{irrRang},</if>
- <if test="totIrrArea != null and totIrrArea != ''">TOT_IRR_AREA = #{totIrrArea},</if>
- <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
- <if test="desIrrArea != null and desIrrArea != ''">DES_IRR_AREA = #{desIrrArea},</if>
- <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
- <if test="runStat != null and runStat != ''">RUN_STAT = #{runStat},</if>
- <if test="irrEngScal != null and irrEngScal != ''">IRR_ENG_SCAL = #{irrEngScal},</if>
- <if test="startDate != null">START_DATE = #{startDate},</if>
- <if test="compDate != null">COMP_DATE = #{compDate},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttIrrBase">
- update ATT_IRR_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="irrCode != null and irrCode != ''">IRR_CODE = #{irrCode},</if>
- <if test="irrName != null and irrName != ''">IRR_NAME = #{irrName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="location != null and location != ''">LOCATION = #{location},</if>
- <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
- <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
- <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
- <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
- <if test="src != null and src != ''">SRC = #{src},</if>
- <if test="irrRang != null and irrRang != ''">IRR_RANG = #{irrRang},</if>
- <if test="totIrrArea != null and totIrrArea != ''">TOT_IRR_AREA = #{totIrrArea},</if>
- <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
- <if test="desIrrArea != null and desIrrArea != ''">DES_IRR_AREA = #{desIrrArea},</if>
- <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
- <if test="runStat != null and runStat != ''">RUN_STAT = #{runStat},</if>
- <if test="irrEngScal != null and irrEngScal != ''">IRR_ENG_SCAL = #{irrEngScal},</if>
- <if test="startDate != null">START_DATE = #{startDate},</if>
- <if test="compDate != null">COMP_DATE = #{compDate},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <update id="updateList" parameterType="java.util.List">
- <foreach collection="list" index="index" item="item" open="begin" close=";end;" separator=";">
- UPDATE ATT_IRR_BASE
- <set>
- GD_X = #{item.gdX},
- GD_Y = #{item.gdY}
- </set>
- <where>
- ID = #{item.id}
- </where>
- </foreach>
- </update>
- </mapper>
|