| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <?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.GwNtcAnnsmntDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt" id="gwNtcAnnsmntResultMap">
- <result property="id" column="ID"/>
- <result property="type" column="TYPE"/>
- <result property="title" column="TITLE"/>
- <result property="content" column="CONTENT"/>
- <result property="url" column="URL"/>
- <result property="note" column="NOTE"/>
- <result property="persId" column="PERS_ID"/>
- <result property="persNm" column="PERS_NM"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="pubState" column="PUB_STATE"/>
- <result property="pubTm" column="PUB_TM"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="disLevel" column="DIS_LEVEL"/>
- </resultMap>
- <sql id="table_columns2">
- ID,
- TYPE,
- TITLE,
- CONTENT,
- URL,
- NOTE,
- PERS_NM,
- ORG_ID,
- ORG_NM,
- PUB_STATE,
- PUB_TM,
- INTM,
- UPTM,
- DIS_LEVEL
- </sql>
- <sql id="table_columns">
- ID,
- TYPE,
- TITLE,
- CONTENT,
- URL,
- NOTE,
- PERS_ID,
- PERS_NM,
- ORG_ID,
- ORG_NM,
- PUB_STATE,
- PUB_TM,
- INTM,
- UPTM,
- DIS_LEVEL
- </sql>
- <sql id="entity_properties">
- #{id},
- #{type},
- #{title},
- #{content},
- #{url},
- #{note},
- #{persId},
- #{persNm},
- #{orgId},
- #{orgNm},
- #{pubState},
- #{pubTm},
- #{intm},
- #{uptm},
- #{disLevel}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="type != null and type != ''">and TYPE = #{type}</if>
- <if test="title != null and title != ''">and TITLE = #{title}</if>
- <if test="content != null and content != ''">and CONTENT = #{content}</if>
- <if test="url != null and url != ''">and URL = #{url}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="persNm != null and persNm != ''">and PERS_NM = #{persNm}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="pubState != null and pubState != ''">and PUB_STATE = #{pubState}</if>
- <if test="disLevel != null and disLevel != ''">and DIS_LEVEL = #{disLevel}</if>
- </trim>
- </sql>
- <select id="get" resultMap="gwNtcAnnsmntResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from GW_NTC_ANNSMNT where ID = #{id}
- </select>
- <select id="getBy" resultMap="gwNtcAnnsmntResultMap">
- select
- <include refid="table_columns"/>
- from GW_NTC_ANNSMNT
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="gwNtcAnnsmntResultMap">
- select
- <include refid="table_columns"/>
- from GW_NTC_ANNSMNT
- </select>
- <select id="findList" resultMap="gwNtcAnnsmntResultMap">
- select
- <include refid="table_columns"/>
- from GW_NTC_ANNSMNT
- <include refid="page_where"/>
- order by DIS_LEVEL
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from GW_NTC_ANNSMNT
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt">
- insert into GW_NTC_ANNSMNT(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from GW_NTC_ANNSMNT where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt">
- delete from GW_NTC_ANNSMNT
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update GW_NTC_ANNSMNT set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt">
- update GW_NTC_ANNSMNT
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="url != null and url != ''">URL = #{url},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="pubState != null and pubState != ''">PUB_STATE = #{pubState},</if>
- <if test="pubTm != null">PUB_TM = #{pubTm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="disLevel != null and disLevel != ''">DIS_LEVEL = #{disLevel},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt">
- update GW_NTC_ANNSMNT
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="url != null and url != ''">URL = #{url},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="pubState != null and pubState != ''">PUB_STATE = #{pubState},</if>
- <if test="pubTm != null">PUB_TM = #{pubTm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="disLevel != null and disLevel != ''">DIS_LEVEL = #{disLevel},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findPagePcInfo" parameterType="cn.com.goldenwater.dcproj.param.GwNtcAnnsmntParam"
- resultType="cn.com.goldenwater.dcproj.model.GwNtcAnnsmnt">
- select
- <include refid="table_columns2"/>
- from GW_NTC_ANNSMNT
- where 1 = 1
- <if test="type != null and type != ''">
- AND type = #{type}
- </if>
- <if test="persNm != null and persNm != ''">
- AND pers_nm like CONCAT('%',CONCAT(#{persNm},'%'))
- </if>
- <if test="intm != null and intm != ''">
- AND intm >= STR_TO_DATE(#{intm},'%Y-%m-%d')
- </if>
- <if test="uptm != null and uptm != ''">
- AND uptm <= STR_TO_DATE(#{uptm},'%Y-%m-%d')
- </if>
- <if test="title != null and title != ''">
- AND title like CONCAT('%',CONCAT(#{title},'%'))
- </if>
- <if test="pubState != null and pubState != ''">
- AND pub_state = #{pubState}
- </if>
- <if test="orgId != null and orgId != ''">
- AND ORG_ID IN (${orgId})
- </if>
- order by DIS_LEVEL
- </select>
- </mapper>
|