| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?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.BisInspUplogDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspUplog" id="bisInspUplogResultMap">
- <result property="id" column="ID"/>
- <result property="persid" column="PERSID"/>
- <result property="intm" column="INTM"/>
- <result property="content" column="CONTENT"/>
- <result property="flagValid" column="FLAG_VALID"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- PERSID,
- <if test="intm != null and intm != ''">INTM,</if>
- CONTENT
- <if test="flagValid != null and flagValid != ''">,FLAG_VALID</if>
- </sql>
- <sql id="entity_properties">
- #{id},
- #{persid},
- <if test="intm != null and intm != ''">#{intm},</if>
- #{content}
- <if test="flagValid != null and flagValid != ''">,#{flagValid}</if>
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="persid != null and persid != ''">and PERSID = #{persid}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="content != null and content != ''">and CONTENT = #{content}</if>
- <if test="flagValid != null">and FLAG_VALID = #{flagValid}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspUplogResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_UPLOG where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspUplogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_UPLOG
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspUplogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_UPLOG
- </select>
- <select id="findList" resultMap="bisInspUplogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_UPLOG
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_UPLOG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspUplog">
- insert into BIS_INSP_UPLOG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_UPLOG where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspUplog">
- delete from BIS_INSP_UPLOG
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_UPLOG set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspUplog">
- update BIS_INSP_UPLOG
- <trim prefix="set" suffixOverrides=",">
- <if test="persid != null and persid != ''">PERSID = #{persid},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspUplog">
- update BIS_INSP_UPLOG
- <trim prefix="set" suffixOverrides=",">
- <if test="persid != null and persid != ''">PERSID = #{persid},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findLogByPersonId" parameterType="cn.com.goldenwater.dcproj.param.BisInspUplogParam"
- resultType="cn.com.goldenwater.dcproj.dto.BisInspUplogDto">
- select A.*,B.PERS_NAME,C.file_path from BIS_INSP_UPLOG A
- LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID=B.GUID
- LEFT JOIN gw_com_file C ON A.ID=C.BIZ_ID
- WHERE A.FLAG_VALID='1'
- <if test="persid != null and persid != ''">AND A.persid = #{persid}</if>
- </select>
- </mapper>
|