forked from luyan/epmet-cloud-lingshan
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.
91 lines
3.8 KiB
91 lines
3.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>
|
|
|
|
<update id="updateBatchLog">
|
|
update log_operation
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<trim prefix="ORG_ID =(case" suffix="end),">
|
|
<foreach collection="list" item="item">
|
|
when OPERATOR_ID = #{item.staffId} then #{item.orgId}
|
|
</foreach>
|
|
</trim>
|
|
<trim prefix="ORG_ID_PATH =(case" suffix="end),">
|
|
<foreach collection="list" item="item">
|
|
when OPERATOR_ID = #{item.staffId} then #{item.orgIdPath}
|
|
</foreach>
|
|
</trim>
|
|
UPDATED_TIME = NOW()
|
|
</trim>
|
|
where 1=1
|
|
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
|
|
OPERATOR_ID = #{item.staffId}
|
|
</foreach>
|
|
</update>
|
|
|
|
<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 %H:%i' ) >= #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND DATE_FORMAT( lo.OPERATING_TIME, '%Y-%m-%d %H:%i' ) <= #{endTime}
|
|
</if>
|
|
ORDER BY lo.OPERATING_TIME DESC
|
|
</select>
|
|
<select id="getStaffId" resultType="java.util.Map">
|
|
SELECT
|
|
OPERATOR_ID,
|
|
CUSTOMER_ID
|
|
FROM log_operation
|
|
GROUP BY OPERATOR_ID
|
|
</select>
|
|
</mapper>
|