mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?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.panzhihua.service_grid.dao.EventGridMemberWarnLogMapper">
 
     <resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.EventGridMemberWarnLogDO">
        <result property="id" column="id"/>
        <result property="gridStreetId" column="grid_street_id"/>
        <result property="gridCommunityId" column="grid_community_id"/>
        <result property="gridId" column="grid_id"/>
        <result property="gridName" column="grid_name"/>
        <result property="gridMemberId" column="grid_member_id"/>
        <result property="lngLat" column="lng_lat"/>
        <result property="content" column="content"/>
        <result property="createBy" column="create_by"/>
        <result property="createAt" column="create_at"/>
    </resultMap>
 
    <sql id="columns">
    <![CDATA[
        id,grid_street_id,grid_community_id,grid_id,grid_name,grid_member_id,lng_lat,content,create_by,create_at
    ]]>
    </sql>
 
 
    <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogVO"
        parameterType="com.panzhihua.common.model.dtos.grid.PageEventGridMemberWarnLogDTO">
        SELECT <include refid="columns" />
        FROM event_grid_member_warn_log
        <where>
           <if test="pageEventGridMemberWarnLogDTO.id!=null">
                AND id = #{pageEventGridMemberWarnLogDTO.id}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.gridStreetId!=null">
                AND grid_street_id = #{pageEventGridMemberWarnLogDTO.gridStreetId}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.gridCommunityId!=null">
                AND grid_community_id = ${pageEventGridMemberWarnLogDTO.gridCommunityId}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.gridId!=null">
                AND grid_id = #{pageEventGridMemberWarnLogDTO.gridId}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.gridName!=null">
                AND grid_name = #{pageEventGridMemberWarnLogDTO.gridName}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.gridMemberId!=null">
                AND grid_member_id = #{pageEventGridMemberWarnLogDTO.gridMemberId}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.lngLat!=null">
                AND lng_lat = #{pageEventGridMemberWarnLogDTO.lngLat}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.content!=null">
                AND content = #{pageEventGridMemberWarnLogDTO.content}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.createBy!=null">
                AND create_by = #{pageEventGridMemberWarnLogDTO.createBy}
            </if>
           <if test="pageEventGridMemberWarnLogDTO.createAtBegin!=null">
                AND create_at &gt;= #{pageEventGridMemberWarnLogDTO.createAtBegin}
           </if>
           <if test="pageEventGridMemberWarnLogDTO.createAtEnd!=null">
                AND create_at &lt;= #{pageEventGridMemberWarnLogDTO.createAtEnd}
           </if>
        </where>
        <if test="pageEventGridMemberWarnLogDTO.sortColumns!=null">
            ORDER BY ${pageEventGridMemberWarnLogDTO.sortColumns} ${pageEventGridMemberWarnLogDTO.sortType}
        </if>
    </select>
 
    <select id="gridMemberWorkWarning" parameterType="com.panzhihua.common.model.dtos.grid.EventGridMemberWainDTO" resultType="com.panzhihua.common.model.vos.grid.EventGridMemberWarnLogAdminVO">
        SELECT
            id,
            position_address,
            content,
            happen_at
        FROM
            event_grid_member_warn_log
        WHERE
            grid_member_id = #{gridMemberWainDTO.gridMemberId}
        <if test="gridMemberWainDTO.keyWord!=null and gridMemberWainDTO.keyWord!= &quot;&quot;">
            AND (content like concat(#{gridMemberWainDTO.keyWord},'%') or position_address like concat(#{gridMemberWainDTO.keyWord},'%'))
        </if>
        order by create_at desc
    </select>
 
    <update id="setUserWorkStatus">
        update sys_user set work_status = #{workStatus} where user_id = #{userId}
    </update>
 
</mapper>