package cn.hnthyy.thmz.mapper.thmz;

import cn.hnthyy.thmz.entity.thmz.ScheduleOfMedicalApply;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ScheduleOfMedicalApplyMapper {

    /**
     * 新增预约记录
     *
     * @param ScheduleOfMedicalApply
     * @return
     */
    @Insert("INSERT INTO t_schedule_of_medical_apply(schedule_id,xdtjcjg,act_order_no,remark,create_dept_no,create_id,create_time) VALUES (#{scheduleId,jdbcType=BIGINT}," +
            "#{xdtjcjg},#{actOrderNo},#{remark},#{createDeptNo,jdbcType=VARCHAR},#{createId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})")
    int insertScheduleOfMedicalApply(ScheduleOfMedicalApply ScheduleOfMedicalApply);

    /**
     * 按照id查询档期预约
     * @param id
     * @return
     */
    @Select("select * from t_schedule_of_medical_apply where id=#{id,jdbcType=BIGINT}")
    ScheduleOfMedicalApply selectById(@Param("id") Long id);


    /**
     * 按照排班id查询档期预约
     * @param scheduleId
     * @return
     */
    @Select("select * from t_schedule_of_medical_apply where schedule_id=#{scheduleId,jdbcType=BIGINT}")
    ScheduleOfMedicalApply selectByScheduleId(@Param("scheduleId") Long scheduleId);


    /**
     * 删除档期预约
     * @param id
     * @return
     */
    @Delete("delete from t_schedule_of_medical_apply where id=#{id,jdbcType=BIGINT}")
    int deleteScheduleOfMedicalApply(@Param("id") Long id);


}
