| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?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="com.ydtech.modules.admin.dao.SysLogDao">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.SysLog">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="user_name" jdbcType="VARCHAR" property="userName"/>
- <result column="url" jdbcType="VARCHAR" property="url"/>
- <result column="description" jdbcType="VARCHAR" property="description"/>
- <result column="method" jdbcType="VARCHAR" property="method"/>
- <result column="request_class" jdbcType="VARCHAR" property="requestClass"/>
- <result column="request_method" jdbcType="VARCHAR" property="requestMethod"/>
- <result column="ip" jdbcType="VARCHAR" property="ip"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ydtech.modules.admin.model.SysLog">
- <result column="params" jdbcType="LONGVARCHAR" property="params"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, user_name, url, description, method, request_class, request_method, ip, create_time
- </sql>
- <sql id="Blob_Column_List">
- params
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
- select
- <include refid="Base_Column_List"/>
- ,
- <include refid="Blob_Column_List"/>
- from sys_log
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from sys_log
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.admin.model.SysLog">
- insert into sys_log (id, user_name, url, description,
- method, request_class, request_method,
- ip, create_time, params)
- values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
- #{description,jdbcType=VARCHAR},
- #{method,jdbcType=VARCHAR}, #{requestClass,jdbcType=VARCHAR}, #{requestMethod,jdbcType=VARCHAR},
- #{ip,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{params,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.admin.model.SysLog">
- insert into sys_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="userName != null">
- user_name,
- </if>
- <if test="url != null">
- url,
- </if>
- <if test="description != null">
- description,
- </if>
- <if test="method != null">
- method,
- </if>
- <if test="requestClass != null">
- request_class,
- </if>
- <if test="requestMethod != null">
- request_method,
- </if>
- <if test="ip != null">
- ip,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="params != null">
- params,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="userName != null">
- #{userName,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- #{url,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- #{description,jdbcType=VARCHAR},
- </if>
- <if test="method != null">
- #{method,jdbcType=VARCHAR},
- </if>
- <if test="requestClass != null">
- #{requestClass,jdbcType=VARCHAR},
- </if>
- <if test="requestMethod != null">
- #{requestMethod,jdbcType=VARCHAR},
- </if>
- <if test="ip != null">
- #{ip,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="params != null">
- #{params,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="selectPaging" parameterType="com.ydtech.modules.admin.model.vo.SysLogQueryVO" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- ,
- <include refid="Blob_Column_List"/>
- from sys_log
- <where>
- <if test="userName != null and userName != ''">
- AND user_name = #{userName,jdbcType=VARCHAR}
- </if>
- <if test="method != null and method != ''">
- AND method = #{method,jdbcType=VARCHAR}
- </if>
- <if test="requestMethod != null and requestMethod != ''">
- AND request_method = #{requestMethod,jdbcType=VARCHAR}
- </if>
- <if test="startDate != null and endDate != null">
- AND DATE_FORMAT(create_time, '%Y-%m-%d') between DATE_FORMAT(#{startDate,jdbcType=VARCHAR}, '%Y-%m-%d')
- and DATE_FORMAT(#{endDate,jdbcType=VARCHAR}, '%Y-%m-%d')
- </if>
- <if test="params != null and params != ''">
- AND params like concat('%' #{params,jdbcType=VARCHAR} '%')
- </if>
- </where>
- order by create_time desc
- </select>
- </mapper>
|