package thyyxxk.webserver.dao.his.medicaladvice.patientinfo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.ZyBedPreMsg;


/**
 * 预分配床位消息表
 * 
 * @author lh
 * @email lihong@gmail.com
 * @date 2023-05-31 10:54:07
 */
@Mapper
public interface ZyBedPreMsgDao extends BaseMapper<ZyBedPreMsg> {
    @Select("  select a.*,b.req_status preBedStatus,b.pre_bed_confirm_remark,b.bed_no  from zy_bed_pre_msg a left  join  mz_zy_req b on a.patient_id=b.patient_id and CONVERT(VARCHAR(30),a.visit_date,20)=CONVERT(VARCHAR(30),b.visit_date,20) ${ew.customSqlSegment} ")
    IPage<ZyBedPreMsg> queryZyBedPreMsgPage(IPage<ZyBedPreMsg> page, @Param(Constants.WRAPPER)QueryWrapper queryWrapper);
}
