<?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.huatek.busi.mapper.OpChangeLogEntityMapper">
	<select id="findOpChangeLogPage"
		parameterType="com.huatek.busi.dto.OpChangeLogEntityDto"
		resultType="com.huatek.busi.vo.OpChangeLogEntityVo">
		SELECT
		  t.id as id,
		  t.entity_class as entityClass,
		  t.op_type as opType,
		  t.object_id as objectId,
		  t.op_content as opContent,
		  t.creator as creator,
		  su.user_name as creatorName,
		  t.created_time as createdTime
		FROM op_change_log_entity t,
		     sys_user su
		WHERE t.creator = su.id
		<if test="creatorName != null and creatorName != ''">
             and su.user_name like concat('%', #{creatorName}, '%')
        </if>
        <if test="createdTime != null">
             and t.created_time &gt;= #{createdTime}
        </if>
        <if test="createdTimeEnd != null">
             and t.created_time &lt; #{createdTimeEnd}
        </if>
	</select>
</mapper>