Newer
Older
huludao / src / main / resources / mapper / SysLogDao.xml
<?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.newfiber.api.pc.dao.SysLogDao">

    <!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="com.newfiber.api.core.bean.SysLog" id="SaveSysLogMap">
        <result property="serial" column="serial"/>
        <result property="sid" column="sid"/>
        <result property="platformName" column="platform_Name"/>
        <result property="operation" column="operation"/>
        <result property="method" column="method"/>
        <result property="params" column="params"/>
        <result property="result" column="result"/>
        <result property="time" column="time"/>
        <result property="ip" column="ip"/>
        <result property="createDate" column="create_Date"/>
        <result property="url" column="url"/>
        <result property="actionType" column="action_Type"/>
    </resultMap>
    <select id="getLogInfos"  resultType="com.newfiber.api.core.bean.SysLog">
        select a.*,(case when b.user_name is null then "app用户" else b.user_name END) userName ,(case when b.user_no is null then "app" else b.user_no end) userNo
        from sys_log a left join sys_user_info b on a.sid = b.user_no
        WHERE 1 = 1
        <if test="st != null and et != null">
            and a.create_date BETWEEN #{st} and #{et}
        </if>
        ORDER by a.create_date desc
        <if test="startPage != null and pageSize != null">
            limit #{startPage},#{pageSize}
        </if>
    </select>
</mapper>