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.
74 lines
2.6 KiB
74 lines
2.6 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.GridVisitedDao">
|
|
|
|
<resultMap type="com.epmet.entity.GridVisitedEntity" id="gridVisitedMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="isRegister" column="IS_REGISTER"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="gridId" column="GRID_ID"/>
|
|
<result property="customerUserId" column="CUSTOMER_USER_ID"/>
|
|
<result property="visitTime" column="VISIT_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="selectGridVisitedByGridIdAndUserId" parameterType="com.epmet.dto.GridVisitedDTO"
|
|
resultType="com.epmet.dto.GridVisitedDTO">
|
|
SELECT
|
|
vi.id,
|
|
vi.is_register,
|
|
vi.customer_id,
|
|
vi.grid_id,
|
|
vi.customer_user_id,
|
|
vi.visit_time,
|
|
vi.del_flag,
|
|
vi.revision,
|
|
vi.created_by,
|
|
vi.created_time,
|
|
vi.updated_by,
|
|
vi.updated_time
|
|
FROM grid_visited vi
|
|
WHERE
|
|
vi.del_flag = '0'
|
|
<if test='customerId != "" and customerId != null'>
|
|
AND vi.customer_id = #{customerId}
|
|
</if>
|
|
<if test='gridId != "" and gridId != null'>
|
|
AND vi.grid_id = #{gridId}
|
|
</if>
|
|
<if test='customerUserId != "" and customerUserId != null'>
|
|
AND vi.customer_user_id = #{customerUserId}
|
|
</if>
|
|
<if test='visitTime != null'>
|
|
AND to_days(vi.visit_time) = to_days(#{visitTime})
|
|
</if>
|
|
ORDER BY
|
|
vi.visit_time DESC
|
|
</select>
|
|
|
|
<update id="updateByVisitedId">
|
|
UPDATE grid_visited
|
|
SET
|
|
visit_time = #{updatedTime},
|
|
updated_by = #{updatedBy},
|
|
updated_time = #{updatedTime}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<update id="deleteBatch" parameterType="java.util.List">
|
|
UPDATE grid_visited
|
|
SET del_flag = '1',
|
|
updated_time = now()
|
|
WHERE
|
|
<foreach collection="ids" item="id" open="" separator="OR" close="">
|
|
ID = #{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|