package thyyxxk.webserver.dao.his.zhuyuanyiji;
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.datamodify.MzChargeDetail;
import java.util.List;
/**
*
* 描述: 门诊项目确认或取消
*
*
* @author xc
* @date 2021-10-09 15:16
*/
@Mapper
public interface MenZhengXiangMuDao {
@Select("select rtrim(patient_id) patient_id,rtrim(name) name from mz_charge_detail " +
"where charge_date >= #{startTime} and charge_date <= #{endTime} " +
"and exec_dept = #{execDept} and group_no = '00' and confirm_flag = 0 " +
"and charge_item_code <> 'BILL99' " +
"group by patient_id ,name")
List kuaiSuChaZhao(@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("execDept") String execDept);
@Select("SELECT mz_patient_mi.name, " +
" mz_patient_mi.sex, " +
" rtrim(mz_patient_mi.patient_id) patient_id, " +
" ic_card_no = cast(mz_patient_mi.ic_card_no as varchar(50)), " +
" mz_patient_mi.birth_day, " +
" mz_patient_mi.phone_no, " +
" mz_patient_mi.adress , " +
" age=space(20), " +
" account_balance=0.00, " +
" account_status =space(2), " +
" times, " +
" response_type, " +
" yb_flag=space(1), " +
" by_flag=space(1), " +
" contract_code=contract_code, " +
" charge_type " +
"FROM mz_patient_mi " +
"where patient_id=#{patientId} or ic_card_no = #{patientId}")
MzChargeDetail getMzPatient(String patientId);
@Select("")
List huoQuMenZhenQueRenShuJu(@Param("patientId") String patientId,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("confirmFlag") Integer confirmFlag);
// 父节点 根据 patient_id times receipt_no order_no charge_item_code
// 子节点 根据 patient_id times receipt_no order_no tc_no
@Select("")
List feiYongXinXi(@Param("realNo") Integer realNo,
@Param("patientNo") String patientNo,
@Param("times") Integer times,
@Param("xiangMuZhuangTai") Integer xiangMuZhuangTai);
/**
* @param patientId 门诊号
* @param times 次数
* @param reqNo 申请号
* @return 缴费的详细信息
*/
@Select("select (unit_price * quantity * drug_win) charge_fee,quantity charge_amount, " +
"(select rtrim(name) from zd_charge_item where code = charge_item_code) " +
"from mz_charge_detail where " +
"req_no = #{reqNo} and unit_price <> 0 and patient_id = #{patientId} and times = #{times} " +
"and group_no = 00 and charge_item_code <> 'BILL99' ")
List getMingXi(@Param("patientId") String patientId,
@Param("times") Integer times,
@Param("reqNo") Integer reqNo);
@Update("")
void xiangMuQueRenHuoQuXiao(@Param("list") List list,
@Param("confirmId") String confirmId,
@Param("execDept") String execDept);
@Update("")
void xiangMuQueRenYjReq(@Param("list") List list,
@Param("confirmId") String confirmId,
@Param("execDept") String execDept);
}