| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?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.TacPawpLawsDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpLaws" id="tacPawpLawsResultMap">
- <result property="tacType" column="TAC_TYPE"/>
- <result property="class1Name" column="CLASS1_NAME"/>
- <result property="class2Name" column="CLASS2_NAME"/>
- <result property="sn" column="SN"/>
- <result property="lawName" column="LAW_NAME"/>
- <result property="id" column="ID"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- TAC_TYPE,
- CLASS1_NAME,
- CLASS2_NAME,
- SN,
- LAW_NAME
- </sql>
- <sql id="entity_properties">
- #{id}
- #{tacType},
- #{class1Name},
- #{class2Name},
- #{sn},
- #{lawName}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="class1Name != null and class1Name != ''">and CLASS1_NAME like '%${class1Name}%'</if>
- <if test="class2Name != null and class2Name != ''">and CLASS2_NAME like '%${class2Name}%'</if>
- <if test="sn != null and sn != ''">and SN = #{sn}</if>
- <if test="lawName != null and lawName != ''">and LAW_NAME like '%${lawName}%'</if>
- <if test="id != null and id != ''">and ID = #{id}</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacPawpLawsResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_LAWS where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacPawpLawsResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_LAWS
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="tacPawpLawsResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_LAWS
- </select>
- <select id="findList" resultMap="tacPawpLawsResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_LAWS
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from TAC_PAWP_LAWS
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpLaws">
- insert into TAC_PAWP_LAWS(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_PAWP_LAWS where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpLaws">
- delete from TAC_PAWP_LAWS
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_PAWP_LAWS set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpLaws">
- update TAC_PAWP_LAWS
- <trim prefix="set" suffixOverrides=",">
- <if test="class1Name != null and class1Name != ''">CLASS1_NAME = #{class1Name},</if>
- <if test="class2Name != null and class2Name != ''">CLASS2_NAME = #{class2Name},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="lawName != null and lawName != ''">LAW_NAME = #{lawName},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpLaws">
- update TAC_PAWP_LAWS
- <trim prefix="set" suffixOverrides=",">
- <if test="class1Name != null and class1Name != ''">CLASS1_NAME = #{class1Name},</if>
- <if test="class2Name != null and class2Name != ''">CLASS2_NAME = #{class2Name},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="lawName != null and lawName != ''">LAW_NAME = #{lawName},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|