| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <?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.TacPawpDrmDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpDrm" id="tacPawpDrmResultMap">
- <result property="id" column="ID"/>
- <result property="listId" column="LIST_ID"/>
- <result property="catalogType" column="CATALOG_TYPE"/>
- <result property="catalogSn" column="CATALOG_SN"/>
- <result property="catalogName" column="CATALOG_NAME"/>
- <result property="note" column="NOTE"/>
- <result property="persId" column="PERS_ID"/>
- <result property="estUnit" column="EST_UNIT"/>
- <result property="estTm" column="EST_TM"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="dataStat" column="DATA_STAT"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- LIST_ID,
- CATALOG_TYPE,
- CATALOG_SN,
- CATALOG_NAME,
- NOTE,
- PERS_ID,
- INTM,
- UPTM,
- DATA_STAT,EST_UNIT,EST_TM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{listId},
- #{catalogType},
- #{catalogSn},
- #{catalogName},
- #{note},
- #{persId},
- #{intm},
- #{uptm},
- #{dataStat},#{estUnit},#{estTm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="listId != null and listId != ''">and LIST_ID = #{listId}</if>
- <if test="catalogType != null and catalogType != ''">and CATALOG_TYPE like '%${catalogType}%'</if>
- <if test="catalogSn != null and catalogSn != ''">and CATALOG_SN = #{catalogSn}</if>
- <if test="catalogName != null and catalogName != ''">and CATALOG_NAME like '%${catalogName}%'</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="persId != null and persId != ''">and PERS_ID IN (SELECT PERSID FROM bis_insp_all_rlation WHERE
- REGEXP_LIKE(
- ID,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId})>0 then
- (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId})
- else (select 'non' from dual) end)
- ||')') AND ID LIKE '008%')
- </if>
- <if test="estTm != null and estTm != ''">and EST_TM = #{estTm}</if>
- <if test="estUnit != null and estUnit != ''">and EST_UNIT like '%${estUnit}%'</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacPawpDrmResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_DRM where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacPawpDrmResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_DRM
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="tacPawpDrmResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_DRM
- </select>
- <select id="findList" resultMap="tacPawpDrmResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PAWP_DRM
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from TAC_PAWP_DRM
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
- insert into TAC_PAWP_DRM(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_PAWP_DRM where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
- delete from TAC_PAWP_DRM
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_PAWP_DRM set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
- update TAC_PAWP_DRM
- <trim prefix="set" suffixOverrides=",">
- <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
- <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
- <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
- <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="estTm != null">EST_TM = #{estTm},</if>
- <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
- update TAC_PAWP_DRM
- <trim prefix="set" suffixOverrides=",">
- <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
- <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
- <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
- <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
- <if test="note != null">NOTE = #{note},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="estTm != null">EST_TM = #{estTm},</if>
- <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|