| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?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.AttCwsBaseCrrctDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttCwsBaseCrrct" id="attCwsBaseCrrctResultMap">
- <result property="guid" column="GUID"/>
- <result property="cwsCode" column="CWS_CODE"/>
- <result property="cwsName" column="CWS_NAME"/>
- <result property="cwsLong" column="CWS_LONG"/>
- <result property="cwsLat" column="CWS_LAT"/>
- <result property="cwsLoc" column="CWS_LOC"/>
- <result property="engType" column="ENG_TYPE"/>
- <result property="wasuType" column="WASU_TYPE"/>
- <result property="wasuRang" column="WASU_RANG"/>
- <result property="desWasuScal" column="DES_WASU_SCAL"/>
- <result property="desWasuPop" column="DES_WASU_POP"/>
- <result property="engStat" column="ENG_STAT"/>
- <result property="startDate" column="START_DATE"/>
- <result property="compDate" column="COMP_DATE"/>
- <result property="note" column="NOTE"/>
- <result property="effDate" column="EFF_DATE"/>
- <result property="exprDate" column="EXPR_DATE"/>
- <result property="addvcd" column="ADDVCD"/>
- <result property="centerXGd" column="CENTER_X_GD"/>
- <result property="centerYGd" column="CENTER_Y_GD"/>
- <result property="edtrPesr" column="EDTR_PESR"/>
- <result property="uptm" column="UPTM"/>
- <result property="compYear" column="COMP_YEAR"/>
- </resultMap>
- <sql id="table_columns">
- GUID ,
- CWS_CODE ,
- CWS_NAME ,
- CWS_LONG ,
- CWS_LAT ,
- CWS_LOC ,
- ENG_TYPE ,
- WASU_TYPE ,
- WASU_RANG ,
- DES_WASU_SCAL ,
- DES_WASU_POP ,
- ENG_STAT ,
- DATE_FORMAT(START_DATE,'%Y-%m-%d %H:%i:%s') START_DATE,
- DATE_FORMAT(COMP_DATE,'%Y-%m-%d') COMP_DATE,
- DATE_FORMAT(COMP_DATE,'%Y') COMP_YEAR,
- NOTE ,
- DATE_FORMAT(EFF_DATE,'%Y-%m-%d %H:%i:%s') EFF_DATE,
- DATE_FORMAT(EXPR_DATE,'%Y-%m-%d %H:%i:%s') EXPR_DATE,
- ADDVCD ,
- CENTER_X_GD ,
- CENTER_Y_GD ,
- EDTR_PESR ,
- DATE_FORMAT(UPTM,'%Y-%m-%d %H:%i:%s') UPTM
- </sql>
- <sql id="table_columns2">
- GUID ,
- CWS_CODE ,
- CWS_NAME ,
- CWS_LONG ,
- CWS_LAT ,
- CWS_LOC ,
- ENG_TYPE ,
- WASU_TYPE ,
- WASU_RANG ,
- DES_WASU_SCAL ,
- DES_WASU_POP ,
- ENG_STAT ,
- START_DATE ,
- COMP_DATE ,
- NOTE ,
- EFF_DATE ,
- EXPR_DATE ,
- ADDVCD ,
- CENTER_X_GD ,
- CENTER_Y_GD ,
- EDTR_PESR ,
- UPTM
- </sql>
- <sql id="entity_properties">
- #{guid},
- #{cwsCode},
- #{cwsName},
- #{cwsLong},
- #{cwsLat},
- #{cwsLoc},
- #{engType},
- #{wasuType},
- #{wasuRang},
- #{desWasuScal},
- #{desWasuPop},
- #{engStat},
- STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s') ,
- STR_TO_DATE(#{compDate},'%Y-%m-%d'),
- #{note},
- STR_TO_DATE(#{effDate},'%Y-%m-%d %H:%i:%s') ,
- STR_TO_DATE(#{exprDate},'%Y-%m-%d %H:%i:%s') ,
- #{addvcd},
- #{centerXGd},
- #{centerYGd},
- #{edtrPesr},
- STR_TO_DATE(#{uptm},'%Y-%m-%d %H:%i:%s')
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="cwsCode != null and cwsCode != ''">and CWS_CODE = #{cwsCode}</if>
- <if test="cwsName != null and cwsName != ''">and CWS_NAME = #{cwsName}</if>
- <if test="cwsLong != null and cwsLong != ''">and CWS_LONG = #{cwsLong}</if>
- <if test="cwsLat != null and cwsLat != ''">and CWS_LAT = #{cwsLat}</if>
- <if test="cwsLoc != null and cwsLoc != ''">and CWS_LOC = #{cwsLoc}</if>
- <if test="engType != null and engType != ''">and ENG_TYPE = #{engType}</if>
- <if test="wasuType != null and wasuType != ''">and WASU_TYPE = #{wasuType}</if>
- <if test="wasuRang != null and wasuRang != ''">and WASU_RANG = #{wasuRang}</if>
- <if test="desWasuScal != null and desWasuScal != ''">and DES_WASU_SCAL = #{desWasuScal}</if>
- <if test="desWasuPop != null and desWasuPop != ''">and DES_WASU_POP = #{desWasuPop}</if>
- <if test="engStat != null and engStat != ''">and ENG_STAT = #{engStat}</if>
- <if test="startDate != null and startDate != ''">and START_DATE = STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="compDate != null and compDate != ''">and COMP_DATE = STR_TO_DATE(#{compDate},'%Y-%m-%d')</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="effDate != null and effDate != ''">and EFF_DATE = STR_TO_DATE(#{effDate},'%Y-%m-%d %H:%i:%s')</if>
- <if test="exprDate != null and exprDate != ''">and EXPR_DATE = STR_TO_DATE(#{exprDate},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="addvcd != null and addvcd != ''">and ADDVCD = #{addvcd}</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="edtrPesr != null and edtrPesr != ''">and EDTR_PESR = #{edtrPesr}</if>
- <if test="uptm != null and uptm != ''">and UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %H:%i:%s')</if>
- </trim>
- </sql>
- <select id="get" resultMap="attCwsBaseCrrctResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from att_cws_base_crrct where GUID = #{id}
- </select>
- <select id="getBy" resultMap="attCwsBaseCrrctResultMap">
- select
- <include refid="table_columns"/>
- from att_cws_base_crrct
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attCwsBaseCrrctResultMap">
- select
- <include refid="table_columns"/>
- from att_cws_base_crrct
- </select>
- <select id="findList" resultMap="attCwsBaseCrrctResultMap">
- select
- <include refid="table_columns"/>
- from att_cws_base_crrct
- <include refid="page_where"/>
- ORDER BY GUID
- </select>
- <select id="selectCount" resultType="int">
- select count(GUID) from att_cws_base_crrct
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttCwsBaseCrrct">
- insert into att_cws_base_crrct(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from att_cws_base_crrct where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttCwsBaseCrrct">
- delete from att_cws_base_crrct
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update att_cws_base_crrct set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttCwsBaseCrrct">
- update att_cws_base_crrct
- <trim prefix="set" suffixOverrides=",">
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
- <if test="cwsName != null and cwsName != ''">CWS_NAME = #{cwsName},</if>
- <if test="cwsLong != null and cwsLong != ''">CWS_LONG = #{cwsLong},</if>
- <if test="cwsLat != null and cwsLat != ''">CWS_LAT = #{cwsLat},</if>
- <if test="cwsLoc != null and cwsLoc != ''">CWS_LOC = #{cwsLoc},</if>
- <if test="engType != null and engType != ''">ENG_TYPE = #{engType},</if>
- <if test="wasuType != null and wasuType != ''">WASU_TYPE = #{wasuType},</if>
- <if test="wasuRang != null and wasuRang != ''">WASU_RANG = #{wasuRang},</if>
- <if test="desWasuScal != null and desWasuScal != ''">DES_WASU_SCAL = #{desWasuScal},</if>
- <if test="desWasuPop != null and desWasuPop != ''">DES_WASU_POP = #{desWasuPop},</if>
- <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
- <if test="startDate != null and startDate != ''">START_DATE = STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="compDate != null and compDate != ''">COMP_DATE = STR_TO_DATE(#{compDate},'%Y-%m-%d'),</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null and effDate != ''">EFF_DATE = STR_TO_DATE(#{effDate},'%Y-%m-%d %H:%i:%s'),</if>
- <if test="exprDate != null and exprDate != ''">EXPR_DATE = STR_TO_DATE(#{exprDate},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</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="edtrPesr != null and edtrPesr != ''">EDTR_PESR = #{edtrPesr},</if>
- <if test="uptm != null and uptm != ''">UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %H:%i:%s'),</if>
- </trim>
- <where>GUID = #{guid}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttCwsBaseCrrct">
- update att_cws_base_crrct
- <trim prefix="set" suffixOverrides=",">
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
- <if test="cwsName != null and cwsName != ''">CWS_NAME = #{cwsName},</if>
- <if test="cwsLong != null and cwsLong != ''">CWS_LONG = #{cwsLong},</if>
- <if test="cwsLat != null and cwsLat != ''">CWS_LAT = #{cwsLat},</if>
- <if test="cwsLoc != null and cwsLoc != ''">CWS_LOC = #{cwsLoc},</if>
- <if test="engType != null and engType != ''">ENG_TYPE = #{engType},</if>
- <if test="wasuType != null and wasuType != ''">WASU_TYPE = #{wasuType},</if>
- <if test="wasuRang != null and wasuRang != ''">WASU_RANG = #{wasuRang},</if>
- <if test="desWasuScal != null and desWasuScal != ''">DES_WASU_SCAL = #{desWasuScal},</if>
- <if test="desWasuPop != null and desWasuPop != ''">DES_WASU_POP = #{desWasuPop},</if>
- <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
- <if test="startDate != null and startDate != ''">START_DATE = STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%S'),
- </if>
- <if test="compDate != null and compDate != ''">COMP_DATE = STR_TO_DATE(#{compDate},'%Y-%m-%d'),</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null and effDate != ''">EFF_DATE = STR_TO_DATE(#{effDate},'%Y-%m-%d %H:%i:%s'),</if>
- <if test="exprDate != null and exprDate != ''">EXPR_DATE = STR_TO_DATE(#{exprDate},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</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="edtrPesr != null and edtrPesr != ''">EDTR_PESR = #{edtrPesr},</if>
- <if test="uptm != null and uptm != ''">UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %H:%i:%s'),</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getCrrctByPersId" resultType="cn.com.goldenwater.dcproj.model.AttCwsBase" parameterType="string">
- SELECT <include refid="table_columns" /> FROM ATT_CWS_BASE_CRRCT
- WHERE CWS_CODE=#{cwsCode} AND EDTR_PESR IN
- (SELECT B.PERSID FROM BIS_INSP_ALL_RLATION A LEFT JOIN BIS_INSP_ALL_RLATION B ON A.ID=B.ID WHERE A.PERSID=#{persId})
- order by uptm desc
- </select>
- </mapper>
|