| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.TacSlbLawIndexDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacSlbLawIndex" id="tacSlbLawIndexResultMap">
- <result property="id" column="ID"/>
- <result property="lawTitle" column="LAW_TITLE"/>
- <result property="lawKeyword" column="LAW_KEYWORD"/>
- <result property="lawModify" column="LAW_MODIFY"/>
- <result property="lawPage" column="LAW_PAGE"/>
- <result property="briefContent" column="BRIEF_CONTENT"/>
- <result property="bookId" column="BOOK_ID"/>
- <result property="docId" column="DOC_ID"/>
- <result property="bookContent" column="BOOK_CONTENT"/>
- <result property="fileId" column="FILE_ID"/>
- <result property="flagValid" column="FLAG_VALID"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- LAW_TITLE,
- LAW_KEYWORD,
- LAW_MODIFY,
- LAW_PAGE,
- BRIEF_CONTENT,
- BOOK_ID,DOC_ID,BOOK_CONTENT,FILE_ID,FLAG_VALID
- </sql>
- <sql id="entity_properties">
- #{id},
- #{lawTitle},
- #{lawKeyword},
- #{lawModify},
- #{lawPage},
- #{briefContent},
- #{bookId},#{docId},#{bookContent},#{fileId},#{flagValid}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="lawTitle != null and lawTitle != ''">and LAW_TITLE = #{lawTitle}</if>
- <if test="lawKeyword != null and lawKeyword != ''">and LAW_KEYWORD like '%${lawKeyword}%'</if>
- <if test="lawModify != null and lawModify != ''">and LAW_MODIFY like '%{lawModify}%'</if>
- <if test="lawPage != null and lawPage != ''">and LAW_PAGE = #{lawPage}</if>
- <if test="briefContent != null and briefContent != ''">and BRIEF_CONTENT = #{briefContent}</if>
- <if test="bookId != null and bookId !=''">and BOOK_ID = #{bookId}</if>
- <if test="docId != null and docId !=''">and DOC_ID = #{docId}</if>
- <if test="bookContent != null and bookContent != ''">and BOOK_CONTENT = #{bookContent}</if>
- and FLAG_VALID = '1'
- </trim>
- </sql>
- <select id="get" resultMap="tacSlbLawIndexResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_SLB_LAW_index where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacSlbLawIndexResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_index <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacSlbLawIndexResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_index where flag_Valid ='1'
- </select>
- <select id="findList" resultMap="tacSlbLawIndexResultMap">
- select <include refid="table_columns" /> from TAC_SLB_LAW_index <include refid="page_where" />
- order by LAW_PAGE asc
- </select>
- <select id="findTopList" resultMap="tacSlbLawIndexResultMap">
- select
- ID,
- LAW_TITLE,
- LAW_KEYWORD,
- LAW_MODIFY,
- LAW_PAGE,
- BRIEF_CONTENT,
- BOOK_ID,DOC_ID,FILE_ID
- from TAC_SLB_LAW_index <include refid="page_where" />
- order by LAW_PAGE asc
- </select>
- <select id="findDocs" resultMap="tacSlbLawIndexResultMap">
- select distinct x.law_title,x.doc_id from TAC_SLB_LAW_index x where x.law_title is not null and flag_Valid ='1'
- <if test="bookId != null ">and BOOK_ID = #{bookId}</if>
- <if test="docId != null ">and DOC_ID = #{docId}</if>
- order by x.doc_id asc
- </select>
- <select id="findListDocs" resultType="cn.com.goldenwater.dcproj.dto.TacSlbLawIndexDto">
- select distinct x.law_title,x.doc_id from TAC_SLB_LAW_index x where x.law_title is not null and flag_Valid ='1'
- <if test="bookId != null ">and BOOK_ID = #{bookId}</if>
- order by x.doc_id asc
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_SLB_LAW_index <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawIndex">
- insert into TAC_SLB_LAW_index( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_SLB_LAW_index where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawIndex">
- delete from TAC_SLB_LAW_index <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_SLB_LAW_index set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawIndex">
- update TAC_SLB_LAW_index
- <trim prefix="set" suffixOverrides=",">
- <if test="lawTitle != null and lawTitle != ''">LAW_TITLE = #{lawTitle},</if>
- <if test="lawKeyword != null and lawKeyword != ''">LAW_KEYWORD = #{lawKeyword},</if>
- <if test="lawModify != null and lawModify != ''">LAW_MODIFY = #{lawModify},</if>
- <if test="lawPage != null and lawPage != ''">LAW_PAGE = #{lawPage},</if>
- <if test="docId != null ">DOC_ID = #{docId},</if>
- BRIEF_CONTENT = #{briefContent},
- <if test="bookId != null ">BOOK_ID = #{bookId},</if>
- <if test="bookContent != null ">BOOK_CONTENT = #{bookContent},</if>
- <if test="fileId != null ">FILE_ID = #{fileId},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacSlbLawIndex">
- update TAC_SLB_LAW_index
- <trim prefix="set" suffixOverrides=",">
- <if test="lawTitle != null and lawTitle != ''">LAW_TITLE = #{lawTitle},</if>
- <if test="lawKeyword != null and lawKeyword != ''">LAW_KEYWORD = #{lawKeyword},</if>
- <if test="lawModify != null and lawModify != ''">LAW_MODIFY = #{lawModify},</if>
- <if test="docId != null and docId != ''">DOC_ID = #{docId},</if>
- <if test="lawPage != null and lawPage != ''">LAW_PAGE = #{lawPage},</if>
- <if test="briefContent != null and briefContent != ''">BRIEF_CONTENT = #{briefContent},</if>
- <if test="bookId != null and bookId != ''">BOOK_ID = #{bookId},</if>
- <if test="bookContent != null ">BOOK_CONTENT = #{bookContent},</if>
- <if test="fileId != null ">FILE_ID = #{fileId},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|