123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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.caimei.mapper.cmMapper.DoctorMapper">
- <insert id="insertDoctor" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandDoctorPo">
- insert into cm_brand_doctor (authUserId, authId, doctorType, name, certificateNo, clubName, image, status, createTime, createBy,
- auditStatus)
- values (#{authUserId}, #{authId}, #{doctorType}, #{name}, #{certificateNo}, #{clubName}, #{image}, #{status}, NOW(), #{createBy}, #{auditStatus})
- </insert>
- <insert id="insertBanner">
- insert into cm_brand_doctor_banner (doctorId, banner)
- VALUES (#{doctorId}, #{banner})
- </insert>
- <insert id="insertEquipment">
- insert into cm_brand_doctor_equipment(doctorId, name, brand, image)
- values (#{doctorId}, #{equipmentName}, #{brand}, #{image})
- </insert>
- <insert id="insertTag">
- insert into cm_brand_doctor_tag (doctorId, tag)
- VALUES (#{doctorId}, #{tag})
- </insert>
- <insert id="insertParam">
- insert into cm_brand_doctor_param(doctorId, name, content)
- values (#{doctorId}, #{name}, #{content})
- </insert>
- <update id="updateDoctorStatus">
- update cm_brand_doctor
- set status = #{status}
- where id = #{doctorId}
- </update>
- <update id="updateDoctorByDoctorId">
- update cm_brand_doctor
- set authId = #{authId},
- doctorType = #{doctorType},
- name = #{name},
- certificateNo = #{certificateNo},
- clubName = #{clubName},
- image = #{image},
- status = #{status},
- auditStatus = #{auditStatus}
- where id = #{id}
- </update>
- <update id="updateDoctorAuditStatus">
- update cm_brand_doctor
- set status = #{status},
- auditStatus = #{auditStatus},
- invalidReason = #{invalidReason},
- auditBy = #{auditBy},
- auditTime = #{auditTime}
- where id = #{doctorId}
- </update>
- <delete id="deleteDoctorByDoctorId">
- delete from cm_brand_doctor where id = #{doctorId}
- </delete>
- <delete id="deleteBanner">
- delete from cm_brand_doctor_banner where doctorId = #{doctorId}
- </delete>
- <delete id="deleteEquipment">
- delete from cm_brand_doctor_equipment where doctorId = #{doctorId}
- </delete>
- <delete id="deleteTag">
- delete from cm_brand_doctor_tag where doctorId = #{doctorId}
- </delete>
- <delete id="deleteParam">
- delete from cm_brand_doctor_param where doctorId = #{doctorId}
- </delete>
- <select id="getDoctorList" resultType="com.caimei.model.vo.DoctorListVo">
- select id as doctorId, a.name as doctorName,a.certificateNo, a.status, a.auditStatus, a.createTime, cu.name as createBy,
- au.name as auditBy,a.auditTime,a.invalidReason
- from cm_brand_doctor a
- left join cm_brand_auth_user cu on a.createBy = cu.authUserId
- left join cm_brand_auth_user au on a.auditBy = au.authUserId
- where a.authUserId = #{authUserId} and doctorType = #{doctorType}
- <if test="doctorName != null and doctorName != ''">
- and a.name like CONCAT('%',#{doctorName},'%')
- </if>
- <if test="certificateNo != null and certificateNo != ''">
- and a.certificateNo like concat('%',#{certificateNo},'%')
- </if>
- <if test="status != null">
- and a.status = #{status}
- </if>
- <if test="auditStatus != null">
- and a.auditStatus = #{auditStatus}
- </if>
- <choose>
- <when test="listType == 2">
- order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc, a.createTime desc
- </when>
- <otherwise>
- order by a.createTime desc
- </otherwise>
- </choose>
- </select>
- <select id="getDoctorById" resultType="com.caimei.model.po.CmBrandDoctorPo">
- select id,
- authId,
- name,
- authUserId,
- certificateNo,
- clubName,
- image,
- status
- from cm_brand_doctor
- where id = #{doctorId}
- </select>
- <select id="getDoctorIdByCertificateNo" resultType="java.lang.Integer">
- select id
- from cm_brand_doctor
- where certificateNo = #{certificateNo}
- and authUserId = #{authUserId}
- limit 1
- </select>
- <select id="getBannerList" resultType="java.lang.String">
- select banner from cm_brand_doctor_banner where doctorId = #{doctorId}
- </select>
- <select id="getEquipmentList" resultType="com.caimei.model.vo.DoctorEquipmentVo">
- select name as equipmentName, brand, image
- from cm_brand_doctor_equipment
- where doctorId = #{doctorId}
- </select>
- <select id="getWxDoctorList" resultType="com.caimei.model.vo.WxDoctorListVo">
- select d.id as doctorId, d.doctorType, d.name as doctorName,d.certificateNo,ifnull(cba.authParty,d.clubName) as clubName,d.image as doctorImage
- from cm_brand_doctor d
- left join cm_brand_auth_user au on d.authUserId = au.authUserId
- left join cm_brand_auth cba on d.authId = cba.id
- where
- au.status = 1
- and d.status = 1
- and d.auditStatus = 1
- <if test="authUserId != null and authUserId != ''">
- and au.authUserId = #{authUserId}
- </if>
- <if test="authId != null">
- and d.authId = #{authId}
- </if>
- <if test="doctorType != null">
- and d.doctorType = #{doctorType}
- </if>
- <if test="doctorName != null and doctorName != ''">
- and d.name like concat('%',#{doctorName},'%')
- </if>
- and au.status = 1
- and d.status = 1
- and d.auditStatus = 1
- </select>
- <select id="getDoctorDetailsById" resultType="com.caimei.model.vo.DoctorFormVo">
- select d.id as doctorId,
- d.doctorType,
- d.name as doctorName,
- certificateNo,
- ifnull(cba.authParty,d.clubName) as clubName,
- image as doctorImage
- from cm_brand_doctor d
- left join cm_brand_auth_user au on d.authUserId = au.authUserId
- left join cm_brand_auth cba on d.authId = cba.id
- where d.id = #{doctorId}
- and au.status = 1
- and d.status = 1
- and d.auditStatus = 1
- </select>
- <select id="getTagList" resultType="java.lang.String">
- select tag from cm_brand_doctor_tag where doctorId = #{doctorId}
- </select>
- <select id="getParamList" resultType="com.caimei.model.vo.ParamVo">
- select name, content
- from cm_brand_doctor_param
- where doctorId = #{doctorId}
- </select>
- </mapper>
|