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
<?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_property.dao.ComPropertyAlarmDao">
 
    <resultMap type="com.panzhihua.service_property.entity.ComPropertyAlarm" id="ComPropertyAlarmBaseResultMap">
        <result property="id" column="id"/>
        <result property="serialNo" column="serial_no"/>
        <result property="type" column="type"/>
        <result property="createTime" column="create_time"/>
        <result property="phone" column="phone"/>
        <result property="name" column="name"/>
        <result property="status" column="status"/>
        <result property="solveId" column="solve_id"/>
        <result property="solveTime" column="solve_time"/>
        <result property="solveContent" column="solve_content"/>
        <result property="communityId" column="community_id"/>
        <result property="solveUrl" column="solve_url"/>
    </resultMap>
 
    <select id="selectList" resultType="com.panzhihua.common.model.vos.property.ComPropertyAlarmVO">
        select t.id,t.serial_no,t.type,t.create_time,t1.phone,t1.username as name,t.status,
            t.solve_id,t.solve_time,t.solve_content,t.community_id,t.solve_url,t1.position,
            t1.longitude,t1.latitude,t2.name as solveName,t4.username as receiveName
        from com_property_alarm t
        left join com_property_equipment t1 on t.serial_no = t1.serial_no
        left join sys_user t2 on t.solve_id = user_id
        left join com_property_equipment t4 on t.receive_no = t4.serial_no
        <where>
            1=1 and t.serial_no not like '70%'
            <if test="commonPage.paramId !=null">
                and t1.community_id = ${commonPage.paramId}
            </if>
            <if test="commonPage.type !=null">
                and t.type =#{commonPage.type}
            </if>
            <if test="commonPage.status !=null">
                and t.status =#{commonPage.status}
            </if>
            <if test="commonPage.address !=null and commonPage.address !=''">
                and t1.position like concat(#{commonPage.address},'%')
            </if>
            <if test="commonPage.username !=null and commonPage.username !=''">
                and t1.username like concat(#{commonPage.username},'%')
            </if>
            <if test="commonPage.beginTime !=null">
                and t.create_time >=#{commonPage.beginTime}
            </if>
            <if test="commonPage.statusBeginTime !=null">
                and t.solve_time >=#{commonPage.statusBeginTime}
            </if>
            <if test="commonPage.endTime !=null">
                and #{commonPage.endTime} >=t.create_time
            </if>
            <if test="commonPage.statusEndTime !=null">
                and #{commonPage.statusEndTime} >=t.solve_time
            </if>
        </where>
        order by t.create_time desc
    </select>
 
 
    <select id="selectById" resultType="com.panzhihua.common.model.vos.property.ComPropertyAlarmVO">
        select t.id,t.serial_no,t.type,t.create_time,t1.phone,t1.username as name,t.status,t.solve_id,t.solve_time,t.solve_content,t.community_id,t.solve_url,t3.address as position,t1.longitude,t1.latitude,t2.name as solveName,t4.username as receiveName from com_property_alarm t
            left join com_property_equipment t1 on t.serial_no = t1.serial_no
            left join com_mng_population_house t3 on t1.village_id=t3.id
            left join sys_user t2 on t.solve_id = user_id
            left join com_property_equipment t4 on t.receive_no = t4.serial_no
        where t.id=#{id}
    </select>
 
</mapper>