<?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>
|