| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?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.AttDomainBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttDomainBase" id="attDomainBaseResultMap">
- <result property="guid" column="GUID"/>
- <result property="domainGuid" column="DOMAIN_GUID"/>
- <result property="domainCode" column="DOMAIN_CODE"/>
- <result property="domainName" column="DOMAIN_NAME"/>
- <result property="domainType" column="DOMAIN_TYPE"/>
- <result property="domainOrder" column="DOMAIN_ORDER"/>
- <result property="status" column="STATUS"/>
- <result property="modifier" column="MODIFIER"/>
- <result property="fromDate" column="FROM_DATE"/>
- <result property="toDate" column="TO_DATE"/>
- <result property="note" column="NOTE"/>
- <result property="nodeCode" column="NODE_CODE"/>
- </resultMap>
-
- <sql id="table_columns">
- GUID,
- DOMAIN_GUID,
- DOMAIN_CODE,
- DOMAIN_NAME,
- DOMAIN_TYPE,
- DOMAIN_ORDER,
- STATUS,
- MODIFIER,
- FROM_DATE,
- TO_DATE,
- NOTE,
- NODE_CODE
- </sql>
- <sql id="entity_properties">
- #{guid},
- #{domainGuid},
- #{domainCode},
- #{domainName},
- #{domainType},
- #{domainOrder},
- #{status},
- #{modifier},
- #{fromDate},
- #{toDate},
- #{note},
- #{nodeCode}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="domainGuid != null and domainGuid != ''">and DOMAIN_GUID = #{domainGuid}</if>
- <if test="domainCode != null and domainCode != ''">and DOMAIN_CODE = #{domainCode}</if>
- <if test="domainName != null and domainName != ''">and DOMAIN_NAME = #{domainName}</if>
- <if test="domainType != null and domainType != ''">and DOMAIN_TYPE = #{domainType}</if>
- <if test="domainOrder != null and domainOrder != ''">and DOMAIN_ORDER = #{domainOrder}</if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
- <if test="fromDate != null">and FROM_DATE = #{fromDate}</if>
- <if test="toDate != null">and TO_DATE = #{toDate}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="nodeCode != null and nodeCode != ''">and NODE_CODE = #{nodeCode}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attDomainBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from att_domain_base where GUID = #{id}
- </select>
- <select id="getBy" resultMap="attDomainBaseResultMap">
- select <include refid="table_columns" /> from att_domain_base <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attDomainBaseResultMap">
- select <include refid="table_columns" /> from att_domain_base
- </select>
- <select id="findList" resultMap="attDomainBaseResultMap">
- select <include refid="table_columns" /> from att_domain_base <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(GUID) from att_domain_base <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttDomainBase">
- insert into att_domain_base( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from att_domain_base where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttDomainBase">
- delete from att_domain_base <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update att_domain_base set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttDomainBase">
- update att_domain_base
- <trim prefix="set" suffixOverrides=",">
- <if test="domainGuid != null and domainGuid != ''">DOMAIN_GUID = #{domainGuid},</if>
- <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
- <if test="domainName != null and domainName != ''">DOMAIN_NAME = #{domainName},</if>
- <if test="domainType != null and domainType != ''">DOMAIN_TYPE = #{domainType},</if>
- <if test="domainOrder != null and domainOrder != ''">DOMAIN_ORDER = #{domainOrder},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- <if test="toDate != null">TO_DATE = #{toDate},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
- </trim>
- <where>GUID = #{guid}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttDomainBase">
- update att_domain_base
- <trim prefix="set" suffixOverrides=",">
- <if test="domainGuid != null and domainGuid != ''">DOMAIN_GUID = #{domainGuid},</if>
- <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
- <if test="domainName != null and domainName != ''">DOMAIN_NAME = #{domainName},</if>
- <if test="domainType != null and domainType != ''">DOMAIN_TYPE = #{domainType},</if>
- <if test="domainOrder != null and domainOrder != ''">DOMAIN_ORDER = #{domainOrder},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- <if test="toDate != null">TO_DATE = #{toDate},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="nodeCode != null and nodeCode != ''">NODE_CODE = #{nodeCode},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|