<?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.kidgrow.oprationcenter.mapper.AdvisoryDoctorInfoMapper">
|
<!--定义查询列-->
|
<sql id="Column_List">
|
*
|
</sql>
|
|
<!--sql查询片段-->
|
<sql id="where">
|
<where>
|
<!--查询条件自行添加-->
|
is_del =0
|
<if test="p.id != null and p.id !=''">
|
and id = #{p.id}
|
</if>
|
<if test="p.doctorId != null and p.doctorId !=''">
|
and doctor_id = #{p.doctorId}
|
</if>
|
<if test="p.hospitalId != null and p.hospitalId !=''">
|
and hospital_id = #{p.hospitalId}
|
</if>
|
<if test="p.service != null and p.service !=''">
|
and service = #{p.service}
|
</if>
|
<if test="p.isDel != null and p.isDel !=''">
|
and is_del = #{p.isDel}
|
</if>
|
<if test="p.excludeHospitalId != null and p.excludeHospitalId !=''">
|
and hospital_id != #{p.excludeHospitalId}
|
</if>
|
</where>
|
</sql>
|
|
<!--列表使用-->
|
<select id="findList" resultType="com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo">
|
SELECT
|
a.*
|
FROM
|
advisory_doctor_info a
|
WHERE
|
a.is_del =0
|
<if test="p.service != null and p.service != ''">
|
and a.service = #{p.service}
|
</if>
|
<if test="p.hospitalName != null and p.hospitalName != ''">
|
and a.hospital_name = #{p.hospitalName}
|
</if>
|
<if test="p.doctorName != null and p.doctorName != ''">
|
and a.doctor_name like concat('%', #{p.doctorName}, '%')
|
</if>
|
order by a.create_time
|
</select>
|
|
<!--删除-->
|
<update id="removeById" parameterType="java.lang.Long">
|
update advisory_doctor_info set is_del=1 where id=#{id}
|
</update>
|
|
<!--定义根据-AdvisoryDoctorInfo当作查询条件返回对象-->
|
<select id="findByObject" resultType="com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo">
|
select
|
<include refid="Column_List"/>
|
from advisory_doctor_info
|
<include refid="where"/>
|
order by id desc
|
</select>
|
</mapper>
|