wuxw
2022-10-28 f78470d16f44a52e05252d19c78d7b58fd5eff27
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
142
143
144
145
<?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="rentingConfigServiceDaoImpl">
 
 
    <!-- 保存房屋出租配置信息 add by wuxw 2018-07-03 -->
    <insert id="saveRentingConfigInfo" parameterType="Map">
        insert into renting_config(
        service_tenant_rate,property_separate_rate,service_price,admin_separate_rate,service_owner_rate,renting_config_id,renting_type,proxy_separate_rate,renting_formula
        ) values (
        #{serviceTenantRate},#{propertySeparateRate},#{servicePrice},#{adminSeparateRate},#{serviceOwnerRate},#{rentingConfigId},#{rentingType},#{proxySeparateRate},#{rentingFormula}
        )
    </insert>
 
 
    <!-- 查询房屋出租配置信息 add by wuxw 2018-07-03 -->
    <select id="getRentingConfigInfo" parameterType="Map" resultType="Map">
        select t.service_tenant_rate,t.service_tenant_rate
        serviceTenantRate,t.property_separate_rate,t.property_separate_rate
        propertySeparateRate,t.service_price,t.service_price servicePrice,t.admin_separate_rate,t.admin_separate_rate
        adminSeparateRate,t.service_owner_rate,t.service_owner_rate
        serviceOwnerRate,t.renting_config_id,t.renting_config_id rentingConfigId,t.status_cd,t.status_cd
        statusCd,t.renting_type,t.renting_type rentingType,t.proxy_separate_rate,t.proxy_separate_rate
        proxySeparateRate,t.renting_formula,t.renting_formula rentingFormula,td1.`name` rentingTypeName,td2.`name` rentingFormulaName
        from renting_config t
        LEFT JOIN t_dict td1 on t.renting_type = td1.status_cd and td1.table_name = 'renting_config' and td1.table_columns = 'renting_type'
        left join t_dict td2 on t.renting_formula = td2.status_cd and td2.table_name = 'renting_config' and td2.table_columns = 'renting_formula'
        where 1 =1
        <if test="serviceTenantRate !=null and serviceTenantRate != ''">
            and t.service_tenant_rate= #{serviceTenantRate}
        </if>
        <if test="propertySeparateRate !=null and propertySeparateRate != ''">
            and t.property_separate_rate= #{propertySeparateRate}
        </if>
        <if test="servicePrice !=null and servicePrice != ''">
            and t.service_price= #{servicePrice}
        </if>
        <if test="adminSeparateRate !=null and adminSeparateRate != ''">
            and t.admin_separate_rate= #{adminSeparateRate}
        </if>
        <if test="serviceOwnerRate !=null and serviceOwnerRate != ''">
            and t.service_owner_rate= #{serviceOwnerRate}
        </if>
        <if test="rentingConfigId !=null and rentingConfigId != ''">
            and t.renting_config_id= #{rentingConfigId}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="rentingType !=null and rentingType != ''">
            and t.renting_type= #{rentingType}
        </if>
        <if test="proxySeparateRate !=null and proxySeparateRate != ''">
            and t.proxy_separate_rate= #{proxySeparateRate}
        </if>
        <if test="rentingFormula !=null and rentingFormula != ''">
            and t.renting_formula= #{rentingFormula}
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
 
    </select>
 
 
    <!-- 修改房屋出租配置信息 add by wuxw 2018-07-03 -->
    <update id="updateRentingConfigInfo" parameterType="Map">
        update renting_config t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="serviceTenantRate !=null and serviceTenantRate != ''">
            , t.service_tenant_rate= #{serviceTenantRate}
        </if>
        <if test="propertySeparateRate !=null and propertySeparateRate != ''">
            , t.property_separate_rate= #{propertySeparateRate}
        </if>
        <if test="servicePrice !=null and servicePrice != ''">
            , t.service_price= #{servicePrice}
        </if>
        <if test="adminSeparateRate !=null and adminSeparateRate != ''">
            , t.admin_separate_rate= #{adminSeparateRate}
        </if>
        <if test="serviceOwnerRate !=null and serviceOwnerRate != ''">
            , t.service_owner_rate= #{serviceOwnerRate}
        </if>
        <if test="rentingType !=null and rentingType != ''">
            , t.renting_type= #{rentingType}
        </if>
        <if test="proxySeparateRate !=null and proxySeparateRate != ''">
            , t.proxy_separate_rate= #{proxySeparateRate}
        </if>
        <if test="rentingFormula !=null and rentingFormula != ''">
            , t.renting_formula= #{rentingFormula}
        </if>
        where 1=1
        <if test="rentingConfigId !=null and rentingConfigId != ''">
            and t.renting_config_id= #{rentingConfigId}
        </if>
 
    </update>
 
    <!-- 查询房屋出租配置数量 add by wuxw 2018-07-03 -->
    <select id="queryRentingConfigsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from renting_config t
        where 1 =1
        <if test="serviceTenantRate !=null and serviceTenantRate != ''">
            and t.service_tenant_rate= #{serviceTenantRate}
        </if>
        <if test="propertySeparateRate !=null and propertySeparateRate != ''">
            and t.property_separate_rate= #{propertySeparateRate}
        </if>
        <if test="servicePrice !=null and servicePrice != ''">
            and t.service_price= #{servicePrice}
        </if>
        <if test="adminSeparateRate !=null and adminSeparateRate != ''">
            and t.admin_separate_rate= #{adminSeparateRate}
        </if>
        <if test="serviceOwnerRate !=null and serviceOwnerRate != ''">
            and t.service_owner_rate= #{serviceOwnerRate}
        </if>
        <if test="rentingConfigId !=null and rentingConfigId != ''">
            and t.renting_config_id= #{rentingConfigId}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="rentingType !=null and rentingType != ''">
            and t.renting_type= #{rentingType}
        </if>
        <if test="proxySeparateRate !=null and proxySeparateRate != ''">
            and t.proxy_separate_rate= #{proxySeparateRate}
        </if>
        <if test="rentingFormula !=null and rentingFormula != ''">
            and t.renting_formula= #{rentingFormula}
        </if>
 
 
    </select>
 
</mapper>