| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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.BisInspAppErrlogDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspAppErrlog" id="bisInspAppErrlogResultMap">
- <result property="id" column="ID"/>
- <result property="persid" column="PERSID"/>
- <result property="intm" column="INTM"/>
- <result property="erlog" column="ERLOG"/>
- <result property="flagValid" column="FLAG_VALID"/>
- <result property="erstate" column="ERSTATE"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- PERSID,
- <if test="intm != null and intm != ''">INTM,</if>
- ERLOG
- <if test="flagValid != null and flagValid != ''">,FLAG_VALID</if>
- <if test="erstate != null and erstate != ''">,ERSTATE</if>
- </sql>
- <sql id="entity_properties">
- #{id},
- #{persid}
- <if test="intm != null and intm != ''">,#{intm}</if>
- ,#{erlog}
- <if test="flagValid != null and flagValid != ''">,#{flagValid}</if>
- <if test="erstate != null and erstate != ''">,#{erstate}</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="erlog != null and erlog != ''">and ERLOG = #{erlog}</if>
- <if test="flagValid != null">and FLAG_VALID = #{flagValid}</if>
- <if test="erstate != null">and ERSTATE = #{erstate}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspAppErrlogResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_APP_ERRLOG where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspAppErrlogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_APP_ERRLOG
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspAppErrlogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_APP_ERRLOG
- </select>
- <select id="findList" resultMap="bisInspAppErrlogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_APP_ERRLOG
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_APP_ERRLOG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
- insert into BIS_INSP_APP_ERRLOG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_APP_ERRLOG where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
- delete from BIS_INSP_APP_ERRLOG
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_APP_ERRLOG set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
- update BIS_INSP_APP_ERRLOG
- <trim prefix="set" suffixOverrides=",">
- <if test="persid != null and persid != ''">PERSID = #{persid},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="erlog != null and erlog != ''">ERLOG = #{erlog},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- <if test="erstate != null">ERSTATE = #{erstate},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
- update BIS_INSP_APP_ERRLOG
- <trim prefix="set" suffixOverrides=",">
- <if test="persid != null and persid != ''">PERSID = #{persid},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="erlog != null and erlog != ''">ERLOG = #{erlog},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- <if test="erstate != null">ERSTATE = #{erstate},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findPersidError" parameterType="cn.com.goldenwater.dcproj.param.BisInspAppErrlogParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspAppErrlogDto">
- select A.*,b.PERS_NAME from BIS_INSP_APP_ERRLOG A
- LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
- ON A.PERSID=B.GUID
- WHERE A.FLAG_VALID='1'
- AND ERSTATE='0'
- <if test="persid != null and persid != ''">AND A.persid = #{persid}</if>
- </select>
- </mapper>
|