| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <?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.BisInspLogDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspLog" id="bisInspLogResultMap">
- <result property="logId" column="LOG_ID"/>
- <result property="userId" column="USER_ID"/>
- <result property="intm" column="INTM"/>
- <result property="content" column="CONTENT"/>
- <result property="path" column="PATH"/>
- <result property="source" column="SRC"/>
- <result property="ipAddr" column="IP_ADDR"/>
- <result property="appModel" column="APP_MODEL"/>
- <result property="username" column="PERS_NAME"/>
- <result property="requestBody" column="REQUEST_BODY"/>
- <result property="responseBody" column="RESPONSE_BODY"/>
- <result property="method" column="METHOD"/>
- <result property="params" column="PARAMS"/>
- <result property="header" column="HEADER"/>
- <result property="orgId" column="ORG_ID"/>
- </resultMap>
- <sql id="table_columns">
- LOG_ID,
- USER_ID,
- INTM,
- CONTENT,
- PATH,
- SRC,
- IP_ADDR,
- APP_MODEL,REQUEST_BODY,RESPONSE_BODY,METHOD,PARAMS,HEADER,ORG_ID
- </sql>
- <sql id="table_columns2">
- A.LOG_ID,
- A.USER_ID,
- A.INTM,
- A.CONTENT,
- A.PATH,
- A.SRC,
- A.IP_ADDR,
- A.APP_MODEL,A.REQUEST_BODY,A.METHOD,A.PARAMS,A.HEADER,A.ORG_ID,
- B.PERS_NAME
- </sql>
- <sql id="entity_properties">
- #{logId},
- #{userId},
- #{intm},
- #{content},
- #{path},
- #{source},
- #{ipAddr},
- #{appModel},#{requestBody},#{responseBody},#{method},#{params},#{header},#{orgId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="userId != null and userId != ''">and USER_ID = #{userId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="content != null and content != ''">and CONTENT = #{content}</if>
- <if test="path != null and path != ''">and PATH = #{path}</if>
- <if test="source != null and source != ''">and SRC = #{source}</if>
- <if test="ipAddr != null and ipAddr != ''">and IP_ADDR = #{ipAddr}</if>
- <if test="appModel != null and appModel != ''">and APP_MODEL = #{appModel}</if>
- <if test="method != null and method != ''">and METHOD = #{method}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- </trim>
- </sql>
- <sql id="page_where2">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="userId != null and userId != ''">and A.USER_ID = #{userId}</if>
- <if test="sttm != null">and A.INTM >= #{sttm}</if>
- <if test="entm != null">and A.INTM <= #{entm}</if>
- <if test="username != null and username != ''">and B.pers_name like concat('%' , #{username} , '%')</if>
- <if test="content != null and content != ''">and A.CONTENT like concat('%' , #{content} , '%')</if>
- <if test="path != null and path != ''">and A.PATH = #{path}</if>
- <if test="source != null and source != ''">and A.SRC = #{source}</if>
- <if test="ipAddr != null and ipAddr != ''">and A.IP_ADDR = #{ipAddr}</if>
- <if test="appModel != null and appModel != ''">and A.APP_MODEL = #{appModel}</if>
- <if test="method != null and method != ''">and A.METHOD = #{method}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspLogResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_LOG where LOG_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspLogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_LOG
- <include refid="page_where"/>
- order by intm desc,log_id
- </select>
- <select id="findAll" resultMap="bisInspLogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_LOG order by intm desc,log_id
- </select>
- <select id="findList" resultMap="bisInspLogResultMap">
- select
- <include refid="table_columns2"/>
- from BIS_INSP_LOG A
- LEFT JOIN BIS_INSP_ALL_RLATION_PERS B ON A.user_id = B.guid
- <include refid="page_where2"/>
- order by A.intm desc,A.log_id
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_LOG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspLog">
- insert into BIS_INSP_LOG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <insert id="insertDelLog" parameterType="cn.com.goldenwater.dcproj.model.BisInspLog" >
- insert into BIS_INSP_DEL_LOG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_LOG where LOG_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspLog">
- delete from BIS_INSP_LOG
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_LOG set flag_valid = 0 where LOG_ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspLog">
- update BIS_INSP_LOG
- <trim prefix="set" suffixOverrides=",">
- <if test="userId != null and userId != ''">USER_ID = #{userId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="path != null and path != ''">PATH = #{path},</if>
- <if test="source != null and source != ''">SRC = #{source},</if>
- <if test="ipAddr != null and ipAddr != ''">IP_ADDR = #{ipAddr},</if>
- <if test="appModel != null and appModel != ''">APP_MODEL = #{appModel},</if>
- <if test="method != null and method != ''">METHOD = #{method},</if>
- <if test="requestBody != null and requestBody != ''">REQUEST_BODY = #{requestBody},</if>
- <if test="responseBody != null and responseBody != ''">RESPONSE_BODY = #{responseBody},</if>
- <if test="params != null and params != ''">PARAMS = #{params},</if>
- <if test="header != null and header != ''">HEADER = #{header},</if>
- </trim>
- <where>LOG_ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspLog">
- update BIS_INSP_LOG
- <trim prefix="set" suffixOverrides=",">
- <if test="userId != null and userId != ''">USER_ID = #{userId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="path != null and path != ''">PATH = #{path},</if>
- <if test="source != null and source != ''">SRC = #{source},</if>
- <if test="ipAddr != null and ipAddr != ''">IP_ADDR = #{ipAddr},</if>
- <if test="appModel != null and appModel != ''">APP_MODEL = #{appModel},</if>
- <if test="method != null and method != ''">METHOD = #{method},</if>
- <if test="requestBody != null and requestBody != ''">REQUEST_BODY = #{requestBody},</if>
- <if test="responseBody != null and responseBody != ''">RESPONSE_BODY = #{responseBody},</if>
- <if test="params != null and params != ''">PARAMS = #{params},</if>
- <if test="header != null and header != ''">HEADER = #{header},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findLogList" resultMap="bisInspLogResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_LOG
- <include refid="page_where"/>
- order by intm,log_id
- </select>
- </mapper>
|