| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?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.TacSlbLawBookDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacSlbLawBook" id="tacSlbLawBookResultMap">
- <result property="id" column="ID"/>
- <result property="bookName" column="BOOK_NAME"/>
- <result property="checkUser" column="CHECK_USER"/>
- <result property="mainEdit" column="MAIN_EDIT"/>
- <result property="member" column="MEMBER"/>
- <result property="note" column="NOTE"/>
- <result property="pubOrg" column="PUB_ORG"/>
- <result property="pubTime" column="PUB_TIME"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- BOOK_NAME,
- CHECK_USER,
- MAIN_EDIT,
- MEMBER,
- NOTE,
- PUB_ORG,
- PUB_TIME
- </sql>
- <sql id="entity_properties">
- #{id},
- #{bookName},
- #{checkUser},
- #{mainEdit},
- #{member},
- #{note},
- #{pubOrg},
- #{pubTime}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="bookName != null and bookName != ''">and BOOK_NAME = #{bookName}</if>
- <if test="checkUser != null and checkUser != ''">and CHECK_USER = #{checkUser}</if>
- <if test="mainEdit != null and mainEdit != ''">and MAIN_EDIT = #{mainEdit}</if>
- <if test="member != null and member != ''">and MEMBER = #{member}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="pubOrg != null and pubOrg != ''">and PUB_ORG = #{pubOrg}</if>
- <if test="pubTime != null and pubTime != ''">and PUB_TIME = #{pubTime}</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacSlbLawBookResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_SLB_LAW_BOOK where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacSlbLawBookResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_BOOK <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacSlbLawBookResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_BOOK
- </select>
- <select id="findList" resultMap="tacSlbLawBookResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_BOOK <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_SLB_LAW_BOOK <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawBook">
- insert into TAC_SLB_LAW_BOOK( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_SLB_LAW_BOOK where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawBook">
- delete from TAC_SLB_LAW_BOOK <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_SLB_LAW_BOOK set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawBook">
- update TAC_SLB_LAW_BOOK
- <trim prefix="set" suffixOverrides=",">
- <if test="bookName != null and bookName != ''">BOOK_NAME = #{bookName},</if>
- <if test="checkUser != null and checkUser != ''">CHECK_USER = #{checkUser},</if>
- <if test="mainEdit != null and mainEdit != ''">MAIN_EDIT = #{mainEdit},</if>
- <if test="member != null and member != ''">MEMBER = #{member},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="pubOrg != null and pubOrg != ''">PUB_ORG = #{pubOrg},</if>
- <if test="pubTime != null and pubTime != ''">PUB_TIME = #{pubTime},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawBook">
- update TAC_SLB_LAW_BOOK
- <trim prefix="set" suffixOverrides=",">
- <if test="bookName != null and bookName != ''">BOOK_NAME = #{bookName},</if>
- <if test="checkUser != null and checkUser != ''">CHECK_USER = #{checkUser},</if>
- <if test="mainEdit != null and mainEdit != ''">MAIN_EDIT = #{mainEdit},</if>
- <if test="member != null and member != ''">MEMBER = #{member},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="pubOrg != null and pubOrg != ''">PUB_ORG = #{pubOrg},</if>
- <if test="pubTime != null and pubTime != ''">PUB_TIME = #{pubTime},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|