<?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.unis.crk.basic.mapper.UserOperationlogMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.basic.entity.UserOperationlog">
                    <id column="uol_id" property="uolId" />
                    <result column="user_id" property="userId" />
                    <result column="operation_time" property="operationTime" />
                    <result column="uot_id" property="uotId" />
                    <result column="parameter_value" property="parameterValue" />
                    <result column="parameter" property="parameter" />
                    <result column="updatetime" property="updatetime" />
        </resultMap>

    <select id="getPerData" resultType="java.util.Map">
        SELECT *   FROM  user_operationlog
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
    </select>
    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT *   FROM  user_operationlog
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
    </select>

    <select id="getPage" resultType="java.util.Map">

        SELECT
        d.*,
        h.username,
        u.*
        FROM
        user_operationlog d
        LEFT JOIN user_info h ON h.user_id = d.user_id LEFT JOIN user_operationtype u on u.uot_id=d.uot_id
        where 1=1
        <if test="ew.sqlSegment != null and  ew.sqlSegment != ''">
            and  ${ew.sqlSegment}
        </if>

    </select>
</mapper>