SysLogsMapper.xml 1.09 KB
Newer Older
qinhu's avatar
1  
qinhu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?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.wise.sc.cement.business.mapper.SysLogsMapper">
    <sql id="where">
        <where>
            <if test="params.startDate != null and params.startDate != ''">
                and DATE(t.create_time) &gt;= #{params.startDate}
            </if>
            <if test="params.endDate != null and params.endDate != ''">
                and DATE(t.create_time) &lt;= #{params.endDate}
            </if>
            <if test="params.objType != null">
                and t.obj_type = #{params.objType}
            </if>
            <if test="params.objId != null">
                and t.obj_id = #{params.objId}
            </if>
        </where>
    </sql>

    <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.LogVo">
        select t.*,su.name as userName
        from sys_logs t
        left join sys_user su on su.id = t.user_id
        <include refid="where"/>
        order by t.create_time desc
    </select>


</mapper>