|
@@ -0,0 +1,107 @@
|
|
|
+<?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.yqh.p2p.dal.dao.AuditLogDao">
|
|
|
+ <resultMap id="BaseResultMap" type="com.yqh.p2p.dal.model.AuditLog">
|
|
|
+ <id column="id_" property="id" jdbcType="BIGINT" />
|
|
|
+ <result column="username_" property="username" jdbcType="VARCHAR" />
|
|
|
+ <result column="operate_name_" property="operateName" jdbcType="VARCHAR" />
|
|
|
+ <result column="interface_url_" property="interfaceUrl"
|
|
|
+ jdbcType="VARCHAR" />
|
|
|
+ <result column="operate_time_" property="operateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="input_params_" property="inputParams" jdbcType="LONGVARCHAR" />
|
|
|
+ <result column="user_ip_" property="userIp" jdbcType="VARCHAR" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id_, username_, operate_name_,
|
|
|
+ interface_url_,input_params_,
|
|
|
+ operate_time_, user_ip_
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="queryCondition">
|
|
|
+ <where>
|
|
|
+ <if test="operateName != null">
|
|
|
+ and operate_name_ = #{operateName}
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ and username_ = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="inputParams != null">
|
|
|
+ and input_params_ like '%' #{inputParams} '%'
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and operate_time_ >= #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ and operate_time_ <= #{endDate}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="get" resultMap="BaseResultMap" parameterType="java.lang.Long">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from p2p_audit_log
|
|
|
+ where id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="delete" parameterType="java.lang.Long">
|
|
|
+ delete from
|
|
|
+ p2p_audit_log
|
|
|
+ where
|
|
|
+ id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.yqh.p2p.dal.model.AuditLog">
|
|
|
+ insert into p2p_audit_log
|
|
|
+ (id_, username_, operate_name_,
|
|
|
+ interface_url_,
|
|
|
+ input_params_,operate_time_,
|
|
|
+ user_ip_)
|
|
|
+ values
|
|
|
+ (#{id,jdbcType=BIGINT},
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
+ #{operateName,jdbcType=VARCHAR},
|
|
|
+ #{interfaceUrl,jdbcType=VARCHAR},
|
|
|
+ #{inputParams,jdbcType=LONGVARCHAR},
|
|
|
+ #{operateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{userIp,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.yqh.p2p.dal.model.AuditLog">
|
|
|
+ update p2p_audit_log
|
|
|
+ <set>
|
|
|
+ <if test="username != null">
|
|
|
+ username_ = #{username,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="operateName != null">
|
|
|
+ operate_name_ = #{operateName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="interfaceUrl != null">
|
|
|
+ interface_url_ = #{interfaceUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="operateTime != null">
|
|
|
+ operate_time_ = #{operateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="userIp != null">
|
|
|
+ user_ip_ = #{userIp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="inputParams != null">
|
|
|
+ input_params_ = #{inputParams,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="queryCount" parameterType="map" resultType="int">
|
|
|
+ select count(*) from p2p_audit_log
|
|
|
+ <include refid="queryCondition" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryPage" parameterType="map" resultMap="BaseResultMap">
|
|
|
+ select * from p2p_audit_log
|
|
|
+ <include refid="queryCondition" />
|
|
|
+ order by operate_time_ desc
|
|
|
+ <include refid="global.limit" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|