linwei
2024-02-04 46498a8f5c219471ef4bb84f3210c71cfa439484
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?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="org.springblade.modules.taskPlaceSelfCheck.mapper.TaskPlaceSelfCheckMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="taskPlaceSelfCheckResultMap" type="org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity">
    </resultMap>
 
 
    <select id="selectTaskPlaceSelfCheckPage" resultMap="taskPlaceSelfCheckResultMap">
        select * from jczz_task_place_self_check where is_deleted = 0
    </select>
 
    <resultMap type="org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO" id="TaskPlaceSelfCheckDTOResult">
        <result property="id"    column="id"    />
        <result property="taskId"    column="task_id"    />
        <result property="taskName"    column="task_name"    />
        <result property="placeName"    column="place_name"    />
        <result property="remark"    column="remark"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="houseCode"    column="house_code"    />
        <result property="rectificationEndTime"    column="rectification_end_time"    />
        <result property="rectificationCompleteTime"    column="rectification_complete_time"    />
        <result property="rectificationFlag"    column="rectification_flag"    />
        <result property="policeStation"    column="police_station"    />
        <result property="rectificationNoticeImgUrl"    column="rectification_notice_img_url"    />
        <result property="signaturePath"    column="signature_path"    />
        <result property="createUser"    column="create_user"    />
        <result property="imageUrls"    column="image_urls"    />
        <result property="status"    column="status"    />
        <result property="deleteFlag"    column="delete_flag"    />
 
        <collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List"
                    select="selectPlacePoiLabelList"
                    ofType="org.springblade.modules.place.vo.PlacePoiLabelVO"
                    autoMapping="true">
        </collection>
 
        <collection property="taskPlaceRecordVOList" column="place_check_id" select="selectPatrolRecordList"
                    javaType="java.util.List" ofType="org.springblade.modules.taskPlaceRecord.vo.TaskPlaceRecordVO"
                    autoMapping="true">
        </collection>
 
    </resultMap>
 
    <select id="selectPlacePoiLabelList" parameterType="Long"
            resultType="org.springblade.modules.place.vo.PlacePoiLabelVO">
            SELECT
            jppl.id,
            jppl.place_id,
            jppl.poi_code,
            jppl.type,
            jppl.color,
            jppl.remark,
            jc.category_name labelName
        FROM
            jczz_place_poi_label jppl
            LEFT JOIN jczz_category jc ON jppl.poi_code = jc.category_no
        WHERE
            jppl.type = '3'
             and  place_id = #{jpid}
        </select>
 
 
    <select id="selectPatrolRecordList" parameterType="Long"
            resultType="org.springblade.modules.patrol.vo.PatrolRecordVO">
            select
            jpr.id,
            jpr.item_id,
            jpr.place_check_id,
            jpr.state,
            jpr.remark,
            jpr.image_urls,
            jpr.create_user,
            jpr.create_time,
            jpr.is_deleted,
            jpr.rectification_image_urls,
            jpr.rectification_remark,
            jpr.rectification_time,
            jpgi.items_name
            from
            jczz_patrol_record jpr
            LEFT JOIN jczz_patrol_group_item jpgi on jpr.item_id= jpgi.id
            where place_check_id = #{id}
        </select>
 
    <sql id="selectTaskPlaceSelfCheck">
        select
            id,
            task_id,
            task_name,
            place_name,
            remark,
            update_time,
            create_time,
            house_code,
            rectification_end_time,
            rectification_complete_time,
            rectification_flag,
            police_station,
            rectification_notice_img_url,
            signature_path,
            create_user,
            image_urls,
            status,
            delete_flag
        from
            jczz_task_place_self_check
    </sql>
 
    <select id="selectTaskPlaceSelfCheckById" parameterType="long" resultMap="TaskPlaceSelfCheckDTOResult">
        <include refid="selectTaskPlaceSelfCheck"/>
        where
        id = #{id}
    </select>
 
    <select id="selectTaskPlaceSelfCheckList" parameterType="org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO" resultMap="TaskPlaceSelfCheckDTOResult">
        <include refid="selectTaskPlaceSelfCheck"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="taskId != null "> and task_id = #{taskId}</if>
            <if test="taskName != null  and taskName != ''"> and task_name = #{taskName}</if>
            <if test="placeName != null  and placeName != ''"> and place_name = #{placeName}</if>
            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="houseCode != null  and houseCode != ''"> and house_code = #{houseCode}</if>
            <if test="rectificationEndTime != null "> and rectification_end_time = #{rectificationEndTime}</if>
            <if test="rectificationCompleteTime != null "> and rectification_complete_time = #{rectificationCompleteTime}</if>
            <if test="rectificationFlag != null "> and rectification_flag = #{rectificationFlag}</if>
            <if test="policeStation != null  and policeStation != ''"> and police_station = #{policeStation}</if>
            <if test="rectificationNoticeImgUrl != null  and rectificationNoticeImgUrl != ''"> and rectification_notice_img_url = #{rectificationNoticeImgUrl}</if>
            <if test="signaturePath != null  and signaturePath != ''"> and signature_path = #{signaturePath}</if>
            <if test="createUser != null "> and create_user = #{createUser}</if>
            <if test="imageUrls != null  and imageUrls != ''"> and image_urls = #{imageUrls}</if>
            <if test="status != null "> and status = #{status}</if>
            <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if>
        </where>
    </select>
</mapper>