package thyyxxk.webserver.dao.his.casefrontsheet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
import java.math.BigDecimal;
/**
*
* 描述: 接收会诊申请
*
*
* @author xc
* @date 2021-07-27 10:29
*/
@Mapper
public interface JieShouHuiZhenDao {
@Select("select bed_no,name,a.admiss_times,a.inpatient_no,req_times,hz_type," +
"dept_code_name = (select rtrim(name) from zd_unit_code with (nolock) where code = dept_code), " +
"req_dept1_name = (select rtrim(name) from zd_unit_code with (nolock) where code = req_dept1) " +
"from ysh_hz_record a with(nolock) " +
" inner join zy_actpatient b with(nolock) on " +
" (b.inpatient_no = a.inpatient_no)" +
" ${ew.customSqlSegment} ")
Page getHuiZhenData(Page page,
@Param(Constants.WRAPPER) QueryWrapper> queryWrapper);
/**
* 根据职称获取医嘱的编码
*
* @param code 职称
* @return 医嘱码
*/
@Select("SELECT order_code FROM zd_emp_title where code = #{code} ")
String getOrderCodeByEmpTit(String code);
@Select("select a.inpatient_no, " +
" b.admiss_date, " +
" rtrim(name) name, " +
" bed_no, " +
" a.admiss_times, " +
" sex, " +
" req_date, " +
" (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept1) req_dept1, " +
" (select birth_date from a_patient_mi with (nolock) where a.inpatient_no = a_patient_mi.inpatient_no) birth_date, " +
" (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept2) req_dept2, " +
" req_times, " +
" (select rtrim(name) name from a_employee_mi with (nolock) where input_id = code) req_doctor, " +
" hz_type, " +
" (select rtrim(name) name " +
" from zd_unit_code with (nolock) " +
" where code = dept_code) dept_code_name, " +
" req_comment, " +
" hz_zd, " +
" hz_md, " +
" hz_comment, " +
" (select rtrim(name) name " +
" from a_employee_mi with (nolock) " +
" where code = hz_doctor2) hz_doctor2_name, " +
" hz_doctor2, " +
" hz_date," +
" cast(act_order_no AS decimal) as act_order_no " +
"from ysh_hz_record a with(nolock) inner join zy_actpatient b with(nolock) on " +
"(b.inpatient_no = a.inpatient_no) where a.admiss_times = #{admissTimes} and a.inpatient_no = #{inpatientNo} and a.req_times = #{reqTimes}")
JieShouHuiZhenPojo getHuanZheXinXi(@Param("admissTimes") Integer admissTimes,
@Param("reqTimes") Integer reqTimes,
@Param("inpatientNo") String inpatientNo);
@Update("")
void wanChenHuiZhen(JieShouHuiZhenPojo param);
@Update("update yz_act_order set order_code = #{code} where act_order_no = #{orderNo} ")
void updateOrderConsultationCode(String code, BigDecimal orderNo);
@Select("select name from zd_unit_code with(nolock) where code = #{deptCode}")
String getDeptName(String deptCode);
}