mitao
2024-06-06 3d2b51ea4520533de5e78f88dddf5b5c7dce4247
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
<?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.sinata.rest.modular.member.dao.MyDoctorMapper">
 
 
    <select id="getDoctorList" resultType="com.sinata.rest.modular.member.model.MyDoctor">
        SELECT
            md.*,TIMESTAMPDIFF(YEAR,md.work_time,NOW()) workTimeNum
        FROM
            my_doctor md
        LEFT JOIN sys_area_city ac on ac.id = md.city_id
        where md.is_delete = 0
        <if test="level != null and level == 1 ">
            and ac.province_code = #{cityCode}
        </if>
        <if test="level != null and level == 2 ">
            and  ac.city_code = #{cityCode}
        </if>
        <if test="level != null and level == 3 ">
            and ac.county_code = #{cityCode}
        </if>
        <if test="memberId != null">
            and find_in_set(#{memberId},md.merchant_id)
        </if>
        <if test="doctorName != null and doctorName != ''">
            and md.name like CONCAT('%',#{doctorName},'%')
        </if>
        order by md.id desc
 
    </select>
</mapper>