| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <?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.AttWagaSapBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttWagaSapBase" id="attWagaSapBaseResultMap">
- <result property="id" column="ID"/>
- <result property="sapName" column="SAP_NAME"/>
- <result property="basCode" column="BAS_CODE"/>
- <result property="diskName" column="DISK_NAME"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="startLoc" column="START_LOC"/>
- <result property="endLoc" column="END_LOC"/>
- <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="riverBank" column="RIVER_BANK"/>
- <result property="lake" column="LAKE"/>
- <result property="coast" column="COAST"/>
- <result property="dikeGrad" column="DIKE_GRAD"/>
- <result property="sapLen" column="SAP_LEN"/>
- <result property="sapType" column="SAP_TYPE"/>
- <result property="chkState" column="CHK_STATE"/>
- <result property="mampu" column="MAMPU"/>
- <result property="mampuAttn" column="MAMPU_ATTN"/>
- <result property="mampuAttnTel" column="MAMPU_ATTN_TEL"/>
- <result property="compUnitAttn" column="COMP_UNIT_ATTN"/>
- <result property="compUnitAttnTel" column="COMP_UNIT_ATTN_TEL"/>
- <result property="gvmtFldWho" column="GVMT_FLD_WHO"/>
- <result property="gvmtFldWhoTel" column="GVMT_FLD_WHO_TEL"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- SAP_NAME,
- BAS_CODE,
- DISK_NAME,
- AD_CODE,
- AD_NAME,
- START_LOC,
- END_LOC,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- RIVER_BANK,
- LAKE,
- COAST,
- DIKE_GRAD,
- SAP_LEN,
- SAP_TYPE,
- CHK_STATE,
- MAMPU,
- MAMPU_ATTN,
- MAMPU_ATTN_TEL,
- COMP_UNIT_ATTN,
- COMP_UNIT_ATTN_TEL,
- GVMT_FLD_WHO,
- GVMT_FLD_WHO_TEL
- </sql>
- <sql id="entity_properties">
- #{id},
- #{sapName},
- #{basCode},
- #{diskName},
- #{adCode},
- #{adName},
- #{startLoc},
- #{endLoc},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{riverBank},
- #{lake},
- #{coast},
- #{dikeGrad},
- #{sapLen},
- #{sapType},
- #{chkState},
- #{mampu},
- #{mampuAttn},
- #{mampuAttnTel},
- #{compUnitAttn},
- #{compUnitAttnTel},
- #{gvmtFldWho},
- #{gvmtFldWhoTel}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="sapName != null and sapName != ''">and SAP_NAME LIKE CONCAT('%', CONCAT(#{sapName} '%'))</if>
- <if test="basCode != null and basCode != ''">and BAS_CODE = #{basCode}</if>
- <if test="diskName != null and diskName != ''">and DISK_NAME = #{diskName}</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="startLoc != null and startLoc != ''">and START_LOC = #{startLoc}</if>
- <if test="endLoc != null and endLoc != ''">and END_LOC = #{endLoc}</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="riverBank != null and riverBank != ''">and RIVER_BANK = #{riverBank}</if>
- <if test="lake != null and lake != ''">and LAKE = #{lake}</if>
- <if test="coast != null and coast != ''">and COAST = #{coast}</if>
- <if test="dikeGrad != null and dikeGrad != ''">and DIKE_GRAD = #{dikeGrad}</if>
- <if test="sapLen != null and sapLen != ''">and SAP_LEN = #{sapLen}</if>
- <if test="sapType != null and sapType != ''">and SAP_TYPE = #{sapType}</if>
- <if test="chkState != null and chkState != ''">and CHK_STATE = #{chkState}</if>
- <if test="mampu != null and mampu != ''">and MAMPU = #{mampu}</if>
- <if test="mampuAttn != null and mampuAttn != ''">and MAMPU_ATTN = #{mampuAttn}</if>
- <if test="mampuAttnTel != null and mampuAttnTel != ''">and MAMPU_ATTN_TEL = #{mampuAttnTel}</if>
- <if test="compUnitAttn != null and compUnitAttn != ''">and COMP_UNIT_ATTN = #{compUnitAttn}</if>
- <if test="compUnitAttnTel != null and compUnitAttnTel != ''">and COMP_UNIT_ATTN_TEL = #{compUnitAttnTel}
- </if>
- <if test="gvmtFldWho != null and gvmtFldWho != ''">and GVMT_FLD_WHO = #{gvmtFldWho}</if>
- <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">and GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="attWagaSapBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_WAGA_SAP_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attWagaSapBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_WAGA_SAP_BASE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attWagaSapBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_WAGA_SAP_BASE
- </select>
- <select id="findList" resultMap="attWagaSapBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_WAGA_SAP_BASE
- <include refid="page_where"/>
- <if test="province != null and province != ''">and AD_CODE LIKE CONCAT(#{province},'%')</if>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_WAGA_SAP_BASE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBase">
- insert into ATT_WAGA_SAP_BASE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update ATT_WAGA_SAP_BASE set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBase">
- update ATT_WAGA_SAP_BASE set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_WAGA_SAP_BASE set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBase">
- update ATT_WAGA_SAP_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
- <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
- <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
- <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</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="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
- <if test="lake != null and lake != ''">LAKE = #{lake},</if>
- <if test="coast != null and coast != ''">COAST = #{coast},</if>
- <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
- <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
- <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
- <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
- <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
- <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
- <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
- <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
- <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
- <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
- <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBase">
- update ATT_WAGA_SAP_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
- <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
- <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
- <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</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="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
- <if test="lake != null and lake != ''">LAKE = #{lake},</if>
- <if test="coast != null and coast != ''">COAST = #{coast},</if>
- <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
- <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
- <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
- <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
- <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
- <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
- <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
- <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
- <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
- <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
- <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|