wuxw
2025-03-26 2ab97974bcc58b6ac15fdf33236c663a6125c473
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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="floorShareMeterV1ServiceDaoImpl">
 
 
    <!-- 保存楼栋公摊表信息 add by wuxw 2018-07-03 -->
    <insert id="saveFloorShareMeterInfo" parameterType="Map">
        insert into floor_share_meter(
        floor_id,meter_num,meter_type,fsm_id,formula_value,community_id,cur_degree,share_type,floor_num,cur_reading_time,
        config_id,config_name,share_price
        ) values (
        #{floorId},#{meterNum},#{meterType},#{fsmId},#{formulaValue},#{communityId},#{curDegree},#{shareType},#{floorNum},#{curReadingTime},
        #{configId},#{configName},#{sharePrice}
        )
    </insert>
 
 
    <!-- 查询楼栋公摊表信息 add by wuxw 2018-07-03 -->
    <select id="getFloorShareMeterInfo" parameterType="Map" resultType="Map">
        select t.floor_id floorId,t.meter_num meterNum,t.meter_type meterType,t.fsm_id fsmId,t.formula_value
        formulaValue,t.status_cd statusCd,t.community_id communityId,t.cur_degree curDegree,t.share_type
        shareType,t.floor_num floorNum,t.cur_reading_time curReadingTime,t.create_time createTime,td.name meterTypeName,
        td1.name shareTypeName,t.config_id configId,t.config_name configName,t.share_price sharePrice
        from floor_share_meter t
        left join t_dict td on t.meter_type = td.status_cd and td.table_name = 'floor_share_meter' and td.table_columns = 'meter_type'
        left join t_dict td1 on t.share_type = td1.status_cd and td1.table_name = 'floor_share_meter' and td1.table_columns = 'share_type'
 
        where 1 =1
        <if test="floorId !=null and floorId != ''">
            and t.floor_id= #{floorId}
        </if>
        <if test="meterNum !=null and meterNum != ''">
            and t.meter_num= #{meterNum}
        </if>
        <if test="meterType !=null and meterType != ''">
            and t.meter_type= #{meterType}
        </if>
        <if test="fsmId !=null and fsmId != ''">
            and t.fsm_id= #{fsmId}
        </if>
        <if test="formulaValue !=null and formulaValue != ''">
            and t.formula_value= #{formulaValue}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="curDegree !=null and curDegree != ''">
            and t.cur_degree= #{curDegree}
        </if>
        <if test="shareType !=null and shareType != ''">
            and t.share_type= #{shareType}
        </if>
        <if test="floorNum !=null and floorNum != ''">
            and t.floor_num= #{floorNum}
        </if>
        <if test="curReadingTime !=null and curReadingTime != ''">
            and t.cur_reading_time= #{curReadingTime}
        </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="updateFloorShareMeterInfo" parameterType="Map">
        update floor_share_meter t set t.status_cd = #{statusCd}
        <if test="meterNum !=null and meterNum != ''">
            , t.meter_num= #{meterNum}
        </if>
        <if test="meterType !=null and meterType != ''">
            , t.meter_type= #{meterType}
        </if>
        <if test="formulaValue !=null and formulaValue != ''">
            , t.formula_value= #{formulaValue}
        </if>
 
        <if test="curDegree !=null and curDegree != ''">
            , t.cur_degree= #{curDegree}
        </if>
        <if test="shareType !=null and shareType != ''">
            , t.share_type= #{shareType}
        </if>
        <if test="floorNum !=null and floorNum != ''">
            , t.floor_num= #{floorNum}
        </if>
        <if test="curReadingTime !=null and curReadingTime != ''">
            , t.cur_reading_time= #{curReadingTime}
        </if>
        <if test="configId !=null and configId != ''">
            , t.config_id= #{configId}
        </if>
        <if test="configName !=null and configName != ''">
            , t.config_name= #{configName}
        </if>
        <if test="sharePrice !=null and sharePrice != ''">
            , t.share_price= #{sharePrice}
        </if>
        where 1=1
        <if test="fsmId !=null and fsmId != ''">
            and t.fsm_id= #{fsmId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="floorId !=null and floorId != ''">
            and t.floor_id= #{floorId}
        </if>
 
    </update>
 
    <!-- 查询楼栋公摊表数量 add by wuxw 2018-07-03 -->
    <select id="queryFloorShareMetersCount" parameterType="Map" resultType="Map">
        select count(1) count
        from floor_share_meter t
        where 1 =1
        <if test="floorId !=null and floorId != ''">
            and t.floor_id= #{floorId}
        </if>
        <if test="meterNum !=null and meterNum != ''">
            and t.meter_num= #{meterNum}
        </if>
        <if test="meterType !=null and meterType != ''">
            and t.meter_type= #{meterType}
        </if>
        <if test="fsmId !=null and fsmId != ''">
            and t.fsm_id= #{fsmId}
        </if>
        <if test="formulaValue !=null and formulaValue != ''">
            and t.formula_value= #{formulaValue}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="curDegree !=null and curDegree != ''">
            and t.cur_degree= #{curDegree}
        </if>
        <if test="shareType !=null and shareType != ''">
            and t.share_type= #{shareType}
        </if>
        <if test="floorNum !=null and floorNum != ''">
            and t.floor_num= #{floorNum}
        </if>
        <if test="curReadingTime !=null and curReadingTime != ''">
            and t.cur_reading_time= #{curReadingTime}
        </if>
 
 
    </select>
 
</mapper>