|
|
|
<?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.StaffGridVisitedDao">
|
|
|
|
|
|
|
|
<resultMap type="com.epmet.entity.StaffGridVisitedEntity" id="staffGridVisitedMap">
|
|
|
|
<result property="id" column="ID"/>
|
|
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
|
|
<result property="gridId" column="GRID_ID"/>
|
|
|
|
<result property="staffId" column="STAFF_ID"/>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<!-- 通过staffId和customerId查询当前用户上一次登录的网格信息 -->
|
|
|
|
<select id="selectStaffLatestGrid" parameterType="com.epmet.dto.form.LatestGridFormDTO" resultType="string">
|
|
|
|
SELECT
|
|
|
|
GRID_ID
|
|
|
|
FROM
|
|
|
|
STAFF_GRID_VISITED
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND
|
|
|
|
CUSTOMER_ID = #{customerId}
|
|
|
|
AND
|
|
|
|
STAFF_ID = #{staffId}
|
|
|
|
ORDER BY
|
|
|
|
CREATED_TIME DESC
|
|
|
|
LIMIT 1
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据staffId和customerId查询当前用户上一次登陆的网格Id,Id,创建时间 -->
|
|
|
|
<select id="selectVisitedRecordByStaffId" resultType="com.epmet.entity.StaffGridVisitedEntity">
|
|
|
|
SELECT
|
|
|
|
ID,
|
|
|
|
GRID_ID,
|
|
|
|
CREATED_TIME
|
|
|
|
FROM
|
|
|
|
STAFF_GRID_VISITED
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND CUSTOMER_ID = #{customerId}
|
|
|
|
|
|
|
|
AND STAFF_ID = #{staffId}
|
|
|
|
|
|
|
|
ORDER BY
|
|
|
|
CREATED_TIME DESC
|
|
|
|
LIMIT 1
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 更新工作人员网格登陆记录的时间 -->
|
|
|
|
<update id="updateRecordTime">
|
|
|
|
UPDATE
|
|
|
|
STAFF_GRID_VISITED
|
|
|
|
SET
|
|
|
|
CREATED_TIME = #{date},
|
|
|
|
UPDATED_TIME = #{date}
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND
|
|
|
|
ID = #{id}
|
|
|
|
</update>
|
|
|
|
</mapper>
|