zhubaomin
2024-10-18 ba55749a30a2a2a09a2c64669d6b344a5d8ddb53
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?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.dy.pipIrrGlobal.daoOp.OpeFeedbackMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeFeedback">
    <!--@mbg.generated-->
    <!--@Table ope_feedback-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="image" jdbcType="VARCHAR" property="image" />
    <result column="audio" jdbcType="VARCHAR" property="audio" />
    <result column="video" jdbcType="VARCHAR" property="video" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="feedbacker_id" jdbcType="BIGINT" property="feedbackerId" />
    <result column="feedback_time" jdbcType="TIMESTAMP" property="feedbackTime" />
    <result column="lng" jdbcType="DOUBLE" property="lng" />
    <result column="lat" jdbcType="DOUBLE" property="lat" />
    <result column="state" jdbcType="TINYINT" property="state" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, content, image, audio, video, phone, feedbacker_id, feedback_time, lng, lat, 
    `state`
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from ope_feedback
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from ope_feedback
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback">
    <!--@mbg.generated-->
    insert into ope_feedback (id, content, image, 
      audio, video, phone, 
      feedbacker_id, feedback_time, lng, 
      lat, `state`)
    values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, 
      #{audio,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{feedbackerId,jdbcType=BIGINT}, #{feedbackTime,jdbcType=TIMESTAMP}, #{lng,jdbcType=DOUBLE}, 
      #{lat,jdbcType=DOUBLE}, #{state,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback">
    <!--@mbg.generated-->
    insert into ope_feedback
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="image != null">
        image,
      </if>
      <if test="audio != null">
        audio,
      </if>
      <if test="video != null">
        video,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="feedbackerId != null">
        feedbacker_id,
      </if>
      <if test="feedbackTime != null">
        feedback_time,
      </if>
      <if test="lng != null">
        lng,
      </if>
      <if test="lat != null">
        lat,
      </if>
      <if test="state != null">
        `state`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="image != null">
        #{image,jdbcType=VARCHAR},
      </if>
      <if test="audio != null">
        #{audio,jdbcType=VARCHAR},
      </if>
      <if test="video != null">
        #{video,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="feedbackerId != null">
        #{feedbackerId,jdbcType=BIGINT},
      </if>
      <if test="feedbackTime != null">
        #{feedbackTime,jdbcType=TIMESTAMP},
      </if>
      <if test="lng != null">
        #{lng,jdbcType=DOUBLE},
      </if>
      <if test="lat != null">
        #{lat,jdbcType=DOUBLE},
      </if>
      <if test="state != null">
        #{state,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback">
    <!--@mbg.generated-->
    update ope_feedback
    <set>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="image != null">
        image = #{image,jdbcType=VARCHAR},
      </if>
      <if test="audio != null">
        audio = #{audio,jdbcType=VARCHAR},
      </if>
      <if test="video != null">
        video = #{video,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="feedbackerId != null">
        feedbacker_id = #{feedbackerId,jdbcType=BIGINT},
      </if>
      <if test="feedbackTime != null">
        feedback_time = #{feedbackTime,jdbcType=TIMESTAMP},
      </if>
      <if test="lng != null">
        lng = #{lng,jdbcType=DOUBLE},
      </if>
      <if test="lat != null">
        lat = #{lat,jdbcType=DOUBLE},
      </if>
      <if test="state != null">
        `state` = #{state,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback">
    <!--@mbg.generated-->
    update ope_feedback
    set content = #{content,jdbcType=VARCHAR},
      image = #{image,jdbcType=VARCHAR},
      audio = #{audio,jdbcType=VARCHAR},
      video = #{video,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      feedbacker_id = #{feedbackerId,jdbcType=BIGINT},
      feedback_time = #{feedbackTime,jdbcType=TIMESTAMP},
      lng = #{lng,jdbcType=DOUBLE},
      lat = #{lat,jdbcType=DOUBLE},
      `state` = #{state,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--自定义查询数量-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select
    count(*) AS recordCount
    from ope_feedback ofb
    left join se_client sc on ofb.feedbacker_id = sc.id
    <where>
      <if test="feedbackerId != null">
        and ofb.feedbacker_id = #{feedbackerId,jdbcType=BIGINT}
      </if>
      <if test="feedbackerName != null">
        and sc.name = #{feedbackerName,jdbcType=VARCHAR}
      </if>
      <if test="timeStart != null">
        and ofb.feedback_time &gt;= #{timeStart,jdbcType=TIMESTAMP}
      </if>
      <if test="timeStop != null">
        and ofb.feedback_time &lt;= #{timeStop,jdbcType=TIMESTAMP}
      </if>
      <if test="state != null">
        and ofb.`state` = #{state,jdbcType=TINYINT}
      </if>
    </where>
  </select>
  <!--自定义查询-->
  <select id="getFeedbacks" resultType="com.dy.pipIrrGlobal.voOp.Vofeedback">
    select
    cast(ofb.id as char) as id,
    ofb.content as content,
    ofb.image as image,
    ofb.audio as audio,
    ofb.video as video,
    ofb.phone as phone,
    cast(ofb.feedbacker_id as char) as feedbackerId,
    ofb.feedback_time as feedbackTime,
    ofb.lng as lng,
    ofb.lat as lat,
    ofb.`state` as state,
    sc.name feedbackerName
    from ope_feedback ofb
    left join se_client sc on ofb.feedbacker_id = sc.id
    <where>
      <if test="feedbackerId != null and feedbackerId != '' ">
        and ofb.feedbacker_id = #{feedbackerId,jdbcType=BIGINT}
      </if>
      <if test="feedbackerName != null and feedbackerName != '' ">
        and sc.name = #{feedbackerName,jdbcType=VARCHAR}
      </if>
      <if test="timeStart != null">
        and ofb.feedback_time &gt;= #{timeStart,jdbcType=TIMESTAMP}
      </if>
      <if test="timeStop != null">
        and ofb.feedback_time &lt;= #{timeStop,jdbcType=TIMESTAMP}
      </if>
      <if test="state != null">
        and ofb.`state` = #{state,jdbcType=TINYINT}
      </if>
    </where>
    order by ofb.id desc
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
</mapper>