You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.8 KiB

<?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.epmet.dao.LogOperationDao">
<resultMap type="com.epmet.entity.LogOperationEntity" id="logOperationMap">
<result property="id" column="ID"/>
<result property="type" column="TYPE"/>
<result property="typeDisplay" column="TYPE_DISPLAY"/>
<result property="content" column="CONTENT"/>
<result property="targetId" column="TARGET_ID"/>
<result property="ip" column="IP"/>
<result property="fromApp" column="FROM_APP"/>
<result property="fromClient" column="FROM_CLIENT"/>
<result property="category" column="CATEGORY"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="operatorId" column="OPERATOR_ID"/>
<result property="operatorName" column="OPERATOR_NAME"/>
<result property="operatorMobile" column="OPERATOR_MOBILE"/>
<result property="operatingTime" column="OPERATING_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="pageList" parameterType="map" resultType="com.epmet.dto.region.LogOperationResultDTO">
SELECT
lo.CATEGORY as category,
lo.TYPE as type,
lo.TYPE_DISPLAY as typeDisplay,
lo.CONTENT as content,
lo.TARGET_ID as targetId,
lo.CUSTOMER_ID as customerId,
lo.OPERATOR_ID as operatorId,
lo.OPERATOR_NAME as operatorName,
lo.OPERATOR_MOBILE as operatorMobile,
lo.OPERATING_TIME as operateTime
FROM
log_operation lo
WHERE
lo.del_flag = '0'
AND lo.CUSTOMER_ID = #{customerId}
<if test="category != null and category != ''">
AND lo.CATEGORY = #{category}
</if>
<if test="operatorName != null and operatorName != ''">
AND lo.OPERATOR_NAME LIKE concat('%',#{operatorName},'%')
</if>
<if test="operatorMobile != null and operatorMobile != ''">
AND lo.OPERATOR_MOBILE LIKE concat('%',#{operatorMobile},'%')
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y%m%d' ) &lt;= #{endTime}
</if>
ORDER BY lo.OPERATING_TIME DESC
</select>
</mapper>