Helius
2021-06-28 c6fc2986a5ad7e422ca4b97ebbacc46fda903ccb
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
<?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.xzx.gc.user.mapper.JhyInfoMapper">
 
    <select id="selectJhyInfoByMobile" resultType="com.xzx.gc.entity.JhyInfo">
        select * from xzx_jhy_info where mobile=#{mobile}
    </select>
 
    <select id="selectJhyInfoByIdentity" resultType="com.xzx.gc.entity.JhyInfo">
        select * from xzx_jhy_info where identity = #{identity}
    </select>
 
    <select id="selectJhyInfoByUserId" resultType="com.xzx.gc.entity.JhyInfo">
        select * from xzx_jhy_info where user_id=#{userId}
    </select>
 
    <select id="selectExistJhyByIndeityOrMobile" resultType="com.xzx.gc.entity.JhyInfo">
        select * from xzx_jhy_info where (mobile=#{mobile} or identity = #{identity}) and status in (1, 2)
    </select>
 
    <select id="selectJhyInfoList" resultType="com.xzx.gc.user.vo.JhyInfoListVo">
        select * from xzx_jhy_info
        <where>
            1=1
            <if test="record.name != null and record.name != ''">
                and (username like CONCAT(CONCAT(#{record.name}, '%'), '%') or phone=#{record.phone})
            </if>
            <if test="record.isJhy != null and record.name != ''">
                and is_jhy=#{record.isJhy}
            </if>
            <if test="record.status != null">
                and status = #{record.status}
            </if>
        </where>
        order by id desc
    </select>
</mapper>