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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?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.ComPropertyRepairDao">
 
    <resultMap type="com.panzhihua.service_property.entity.ComPropertyRepair" id="ComPropertyRepairBaseResultMap">
        <result property="id" column="id"/>
        <result property="repairContent" column="repair_content"/>
        <result property="repairName" column="repair_name"/>
        <result property="repairPhone" column="repair_phone"/>
        <result property="repairPosition" column="repair_position"/>
        <result property="repairStatus" column="repair_status"/>
        <result property="createTime" column="create_time"/>
        <result property="repairUrl" column="repair_url"/>
        <result property="replyContent" column="reply_content"/>
        <result property="replyUrl" column="reply_url"/>
        <result property="replyTime" column="reply_time"/>
        <result property="createBy" column="create_by"/>
        <result property="feedbackBy" column="feedback_by"/>
        <result property="feedbackContent" column="feedback_content"/>
        <result property="feedbackUrl" column="feedback_url"/>
        <result property="feedbackTime" column="feedback_time"/>
        <result property="replyScore" column="reply_score"/>
        <result property="propertyId" column="property_id"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.property.ComPropertyRepairVO" parameterType="com.panzhihua.common.model.dtos.property.CommonPage">
        select t.*,t1.name as feedback,t3.name as areaName from com_property_repair t left join sys_user t1 on t.feedback_by = t1.user_id left join com_property t2 on t.property_id = t2.area_id left join com_mng_village t3 on t.property_id=t3.village_id
        <where>
            1=1
            <if test="commonPage.status !=null">
                and t.repair_status =#{commonPage.status}
            </if>
            <if test="commonPage.username !=null and commonPage.username.trim() !=''">
                and t.repair_name  like concat(#{commonPage.username},'%')
            </if>
            <if test="commonPage.phone !=null and commonPage.phone.trim() !=''">
                and t.repair_phone like concat(#{commonPage.phone},'%')
            </if>
            <if test="commonPage.address !=null and commonPage.address.trim() !=''">
                and t.repair_position like  concat(#{commonPage.address},'%')
            </if>
            <if test="commonPage.beginTime !=null">
                and t.create_time >=#{commonPage.beginTime}
            </if>
            <if test="commonPage.endTime !=null">
                and #{commonPage.endTime} >=t.create_time
            </if>
            <if test="commonPage.systemName !=null and commonPage.systemName.trim() !=''">
                and t1.name like concat(#{commonPage.systemName},'%')
            </if>
            <if test="commonPage.paramId !=null and commonPage.paramId !=0">
                and t2.community_id = ${commonPage.paramId}
            </if>
            <if test="commonPage.areaId !=null and commonPage.areaId !=0">
                and t2.area_id =#{commonPage.areaId}
            </if>
            <if test="commonPage.userId !=null">
                and t.create_by =#{commonPage.userId}
            </if>
            <if test="commonPage.propertyId != null and commonPage.propertyId != ''">
                AND t.property_id=#{commonPage.propertyId}
            </if>
        </where>
    order by t.create_time desc
    </select>
 
    <select id="selectDetail" resultType="com.panzhihua.common.model.vos.property.ComPropertyRepairVO">
        select t.*,t1.name as feedback from com_property_repair t left join sys_user t1 on t.feedback_by = t1.user_id where t.id=#{id}
    </select>
    <select id="pageList2" resultType="com.panzhihua.common.model.vos.property.ComPropertyRepairVO">
    select t.*,t1.name as feedback from com_property_repair t left join sys_user t1 on t.feedback_by = t1.user_id left join com_property t2 on t.property_id = t2.area_id left join com_mng_village t3 on t.property_id=t3.village_id
    <where>
        1=1
        <if test="commonPage.status !=null">
            and t.repair_status =#{commonPage.status}
        </if>
        <if test="commonPage.username !=null and commonPage.username.trim() !=''">
            and t.repair_name  like concat(#{commonPage.username},'%')
        </if>
        <if test="commonPage.phone !=null and commonPage.phone.trim() !=''">
            and t.repair_phone like concat(#{commonPage.phone},'%')
        </if>
        <if test="commonPage.address !=null and commonPage.address.trim() !=''">
            and t.repair_position like  concat(#{commonPage.address},'%')
        </if>
        <if test="commonPage.beginTime !=null">
            and t.create_time >=#{commonPage.beginTime}
        </if>
        <if test="commonPage.endTime !=null">
            and #{commonPage.endTime} >=t.create_time
        </if>
        <if test="commonPage.systemName !=null and commonPage.systemName.trim() !=''">
            and t1.name like concat(#{commonPage.systemName},'%')
        </if>
        <if test="commonPage.paramId !=null and commonPage.paramId !=0">
            and t2.community_id = ${commonPage.paramId}
        </if>
        <if test="commonPage.areaId !=null and commonPage.areaId !=0">
            and t2.area_id =#{commonPage.areaId}
        </if>
        <if test="commonPage.userId !=null">
            and t.create_by =#{commonPage.userId}
        </if>
        <if test="commonPage.propertyId != null and commonPage.propertyId != ''">
            AND t.property_id=#{commonPage.propertyId}
        </if>
    </where>
    </select>
</mapper>