rest-password-mapper.xml
2.06 KB
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
<?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">
<!-- 找回密码 user_rest_password @author kongmingke -->
<mapper namespace="com.cjs.cms.dao.user.account.ResetPasswordDao">
<sql id="user_reset_password_field">
id, name, user_number, phone, bust, card_front,
card_number, band_card_front, create_time, audit_time, audit_status,
remark
</sql>
<sql id="searchCondition">
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%') </if>
<if test="userNumber != null and userNumber != ''"> and user_number like concat('%', #{userNumber}, '%') </if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%') </if>
<if test="cardNumber != null and cardNumber != ''"> and card_number like concat('%', #{cardNumber}, '%') </if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="beginDate != null and endDate == null">
and create_time > = #{beginDate}
</if>
<if test="endDate != null and beginDate == null">
and DATE_ADD(#{endDate}, INTERVAL +1 day)> =
create_time
</if>
<if test="endDate != null and beginDate != null">
and create_time between #{beginDate} and
DATE_ADD(#{endDate}, INTERVAL +1 day)
</if>
</sql>
<select id="searchList" parameterType="map" resultType="ResetPasswordInfo">
select
<include refid="user_reset_password_field" />
from reset_password where 1 = 1
<include refid="searchCondition" />
order by create_time desc
<include refid="common.pageLimit" />
</select>
<select id="searchListCount" parameterType="map" resultType="int">
select count(*)
from reset_password where 1 = 1
<include refid="searchCondition" />
</select>
<update id="updateAuditStatus" parameterType="map">
update reset_password set audit_status = #{auditStatus}, audit_time = now()
where id = #{id}
</update>
<update id="updateRemark" parameterType="map">
update reset_password set remark = #{remark} where id = #{id}
</update>
</mapper>