| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.DictTypeDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.DictType" id="dictTypeResultMap">
- <result property="id" column="ID"/>
- <result property="dictTypeCd" column="DICT_TYPE_CD"/>
- <result property="dictTypeDesc" column="DICT_TYPE_DESC"/>
- <result property="defaultVal" column="DEFAULT_VAL"/>
- <result property="flagValid" column="FLAG_VALID"/>
- <result property="ownerOfc" column="OWNER_OFC"/>
- <result property="ownerSystem" column="OWNER_SYSTEM"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- DICT_TYPE_CD,
- DICT_TYPE_DESC,
- DEFAULT_VAL,
- FLAG_VALID,
- OWNER_OFC,
- OWNER_SYSTEM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{dictTypeCd},
- #{dictTypeDesc},
- #{defaultVal},
- #{flagValid},
- #{ownerOfc},
- #{ownerSystem}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="dictTypeCd != null and dictTypeCd != ''">and DICT_TYPE_CD = #{dictTypeCd}</if>
- <if test="dictTypeDesc != null and dictTypeDesc != ''">and DICT_TYPE_DESC = #{dictTypeDesc}</if>
- <if test="defaultVal != null and defaultVal != ''">and DEFAULT_VAL = #{defaultVal}</if>
- <if test="flagValid != null and flagValid != ''">and FLAG_VALID = #{flagValid}</if>
- <if test="ownerOfc != null and ownerOfc != ''">and OWNER_OFC = #{ownerOfc}</if>
- <if test="ownerSystem != null and ownerSystem != ''">and OWNER_SYSTEM = #{ownerSystem}</if>
- </trim>
- </sql>
- <select id="get" resultMap="dictTypeResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from GW_COM_DICT_TYPE where ID = #{id}
- </select>
- <select id="getBy" resultMap="dictTypeResultMap">
- select
- <include refid="table_columns"/>
- from GW_COM_DICT_TYPE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="dictTypeResultMap">
- select
- <include refid="table_columns"/>
- from GW_COM_DICT_TYPE
- </select>
- <select id="findList" resultMap="dictTypeResultMap">
- select
- <include refid="table_columns"/>
- from GW_COM_DICT_TYPE
- <include refid="page_where"/> order by dict_type_cd asc
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from GW_COM_DICT_TYPE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.DictType">
- insert into GW_COM_DICT_TYPE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from GW_COM_DICT_TYPE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.DictType">
- update GW_COM_DICT_TYPE set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update GW_COM_DICT_TYPE set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.DictType">
- update GW_COM_DICT_TYPE
- <trim prefix="set" suffixOverrides=",">
- <if test="dictTypeCd != null and dictTypeCd != ''">DICT_TYPE_CD = #{dictTypeCd},</if>
- <if test="dictTypeDesc != null and dictTypeDesc != ''">DICT_TYPE_DESC = #{dictTypeDesc},</if>
- <if test="defaultVal != null and defaultVal != ''">DEFAULT_VAL = #{defaultVal},</if>
- <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
- <if test="ownerOfc != null and ownerOfc != ''">OWNER_OFC = #{ownerOfc},</if>
- <if test="ownerSystem != null and ownerSystem != ''">OWNER_SYSTEM = #{ownerSystem},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.DictType">
- update GW_COM_DICT_TYPE
- <trim prefix="set" suffixOverrides=",">
- <if test="dictTypeCd != null and dictTypeCd != ''">DICT_TYPE_CD = #{dictTypeCd},</if>
- <if test="dictTypeDesc != null and dictTypeDesc != ''">DICT_TYPE_DESC = #{dictTypeDesc},</if>
- <if test="defaultVal != null and defaultVal != ''">DEFAULT_VAL = #{defaultVal},</if>
- <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
- <if test="ownerOfc != null and ownerOfc != ''">OWNER_OFC = #{ownerOfc},</if>
- <if test="ownerSystem != null and ownerSystem != ''">OWNER_SYSTEM = #{ownerSystem},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|