Newer
Older
huludao / src / main / resources / mapper / Log / 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.Log.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="platformName"/>
        <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" parameterType="Map" 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 huludao_main.sys_log a left join huludao_main.sys_user_info b on a.sid = b.User_No
        WHERE a.action_Type = #{type}
        <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>