123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- 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;
- /**
- * <p>
- * 描述: 门诊项目确认或取消
- * </p>
- *
- * @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<MzChargeDetail> 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("<script>" +
- "select charge_date,real_no,rtrim(patient_id) patient_id,times " +
- "from mz_charge_detail where charge_date >= #{startTime} and charge_date <= #{endTime} and " +
- "patient_id = #{patientId} and pay_mark = '0' " +
- "<if test=\"confirmFlag == 0 \">" +
- "and (confirm_flag = 0 or confirm_flag = 3) " +
- "</if>" +
- "<if test=\"confirmFlag != 0 \">" +
- "and confirm_flag = 1" +
- "</if>" +
- "and group_no = '00' and charge_item_code <> 'BILL99' " +
- "group by charge_date,real_no,patient_id,times " +
- "</script>")
- List<MzChargeDetail> 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("<script>" +
- "select confirm_flag,rtrim(patient_id) patient_id ,times,item_no,receipt_no,order_no,req_no, " +
- " rtrim(charge_item_code) charge_item_code,rtrim(isnull(tc_no,'')) tc_no,rtrim(tc_name) tc_name," +
- " rtrim(bill_item_code) bill_item_code,exec_dept," +
- " charge_name = (select rtrim(name) from zd_charge_item where charge_item_code = code)," +
- " quantity,drug_win,unit_price, " +
- " exec_dept_name= (select rtrim(name) from zd_unit_code where code = exec_dept), " +
- " confirm_id,confirm_id_name = (select rtrim(name) from a_employee_mi where code = confirm_id), " +
- " confirm_time " +
- " from mz_charge_detail " +
- "where real_no = #{realNo} and patient_id = #{patientNo} and times = #{times} " +
- "and pay_mark = '0' and group_no = '00' and charge_item_code <> 'BILL99' " +
- "<if test=\"xiangMuZhuangTai != null and xiangMuZhuangTai == 0 \">" +
- "and (confirm_flag = 0 or confirm_flag = 3) " +
- "</if>" +
- "<if test=\"xiangMuZhuangTai !=null and xiangMuZhuangTai == 1 \">" +
- "and confirm_flag = 1" +
- "</if>" +
- "</script>")
- List<MzChargeDetail> 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<MzChargeDetail> getMingXi(@Param("patientId") String patientId,
- @Param("times") Integer times,
- @Param("reqNo") Integer reqNo);
- @Update("<script>" +
- "<foreach collection='list' item='item' separator=';'> " +
- "update mz_charge_detail " +
- "<set>" +
- " confirm_flag = #{item.confirmFlag} , receive_flag = #{item.confirmFlag} " +
- "<choose>" +
- "<when test=\"item.confirmFlag == 1\">" +
- ",confirm_time =getdate() , exec_dept =#{execDept},confirm_id =#{confirmId}" +
- "</when>" +
- "<otherwise>" +
- ",confirm_time = null,confirm_id = null" + // , exec_dept = null
- "</otherwise>" +
- "</choose>" +
- "</set>" +
- "where " +
- "patient_id = #{item.patientId} and times =#{item.times} " +
- "and item_no = #{item.itemNo} and charge_item_code = #{item.chargeItemCode} " +
- "and receipt_no = #{item.receiptNo} and order_no = #{item.orderNo} " +
- "and req_no =#{item.reqNo} " +
- "</foreach>" +
- "</script>")
- void xiangMuQueRenHuoQuXiao(@Param("list") List<MzChargeDetail> list,
- @Param("confirmId") String confirmId,
- @Param("execDept") String execDept);
- @Update("<script>" +
- "<foreach collection='list' item='item' separator=';'> " +
- "update mz_yj_req " +
- "<set>" +
- " confirm_flag = #{item.confirmFlag} , receive_flag = #{item.confirmFlag} " +
- "<choose>" +
- "<when test=\"item.confirmFlag == 1\">" +
- ",confirm_time =getdate() , exec_dept =#{execDept},confirm_id =#{confirmId}" +
- "</when>" +
- "<otherwise>" +
- ",confirm_time = null ,confirm_id = null" + // , exec_dept = null
- "</otherwise>" +
- "</choose>" +
- "</set>" +
- "where " +
- "patient_id = #{item.patientId} and times =#{item.times} " +
- "and item_no = #{item.itemNo} " +
- "and receipt_no = #{item.receiptNo} and order_no = #{item.orderNo} " +
- "and req_no =#{item.reqNo} " +
- "</foreach>" +
- "</script>")
- void xiangMuQueRenYjReq(@Param("list") List<MzChargeDetail> list,
- @Param("confirmId") String confirmId,
- @Param("execDept") String execDept);
- }
|