|
@@ -19,9 +19,19 @@ import java.util.List;
|
|
|
@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, " +
|
|
|
- " mz_patient_mi.patient_id, " +
|
|
|
+ " 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, " +
|
|
@@ -40,126 +50,50 @@ public interface MenZhengXiangMuDao {
|
|
|
MzChargeDetail getMzPatient(String patientId);
|
|
|
|
|
|
|
|
|
- @Select("SELECT patient_id =max(a.patient_id), " +
|
|
|
- " times =max(a.times), " +
|
|
|
- " serial_no =a.serial_no, " +
|
|
|
- " charge_date=max(a.charge_date) " +
|
|
|
- "FROM mz_receipt_serial a " +
|
|
|
- "where patient_id=#{patientId} and " +
|
|
|
- " charge_date >= #{startTime} and " +
|
|
|
- " charge_date <= #{endTime} and " +
|
|
|
- " isnull(tf_flag,'') <> '1' " +
|
|
|
- "group by serial_no " +
|
|
|
- "having sum(total_charge) - sum(charge10 + charge11 + charge12) > 0")
|
|
|
- List<MzChargeDetail> getFeiYong(@Param("patientId") String patientId,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime);
|
|
|
-
|
|
|
- @Select("SELECT patient_id =max(a.patient_id), " +
|
|
|
- " times =max(a.times), " +
|
|
|
- " serial_no =a.serial_no, " +
|
|
|
- " charge_date=max(a.charge_date), " +
|
|
|
- " confirm_date=max(a.confirm_time) " +
|
|
|
- "FROM mz_charge_detail a ,zd_unit_code d " +
|
|
|
- "where a.exec_dept=d.code and " +
|
|
|
- " patient_id=#{patientId} and " +
|
|
|
- " charge_date >= #{startTime} and " +
|
|
|
- " charge_date <= #{endTime} and " +
|
|
|
- " isnull(a.confirm_flag,'') in ('1','3') and " +
|
|
|
- " (a.exec_dept=#{dept} or d.parent_code_hs=#{dept}) and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.group_no='00' " +
|
|
|
- "group by serial_no")
|
|
|
- List<MzChargeDetail> getYiQueRenFeiYong(@Param("patientId") String patientId,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime,
|
|
|
- @Param("dept") String dept);
|
|
|
-
|
|
|
- @Select("SELECT patient_id=rtrim(a.patient_id), " +
|
|
|
- " times=a.times, " +
|
|
|
- " receipt_no=a.receipt_no, " +
|
|
|
- " order_no=a.order_no, " +
|
|
|
- " item_no=a.item_no, " +
|
|
|
- " charge_code=a.charge_item_code, " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " je =round(quantity * unit_price,2), " +
|
|
|
- " serial_no=a.serial_no, " +
|
|
|
- " confirm_time=a.confirm_time, " +
|
|
|
- " confirm_id=a.confirm_id, " +
|
|
|
- " confirm_id_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = confirm_id)," +
|
|
|
- " exec_dept=a.exec_dept, " +
|
|
|
- " exec_dept_name = (select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.exec_dept), " +
|
|
|
- " confirm_flag=isnull(a.confirm_flag,'0'), " +
|
|
|
- " req_no =a.req_no " +
|
|
|
- "FROM mz_charge_detail a ,zd_charge_item b " +
|
|
|
- "where a.serial_no =#{serialNo} and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.charge_item_code=b.code and " +
|
|
|
- " isnull(a.req_no,0)=0 " +
|
|
|
- " " +
|
|
|
- "union " +
|
|
|
- " " +
|
|
|
- "SELECT patient_id=rtrim(a.patient_id), " +
|
|
|
- " times =a.times, " +
|
|
|
- " receipt_no=a.receipt_no, " +
|
|
|
- " order_no=a.order_no, " +
|
|
|
- " item_no=a.item_no, " +
|
|
|
- " charge_code=a.order_code, " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " je =0.00, " +
|
|
|
- " serial_no =a.serial_no, " +
|
|
|
- " confirm_time=a.confirm_time, " +
|
|
|
- " confirm_id =a.confirm_id, " +
|
|
|
- " confirm_id_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = confirm_id), " +
|
|
|
- " exec_dept =a.exec_dept, " +
|
|
|
- " exec_dept_name = (select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.exec_dept), " +
|
|
|
- " confirm_flag=isnull(a.confirm_flag,'0'), " +
|
|
|
- " req_no =a.req_no " +
|
|
|
- "FROM mz_yj_req a ,jy_zd_item b " +
|
|
|
- "where a.patient_id =#{patientId} and " +
|
|
|
- " a.times =#{times} and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.order_code =b.code and " +
|
|
|
- " isnull(a.req_no,0) > 0 " +
|
|
|
- "union " +
|
|
|
- " " +
|
|
|
- "SELECT patient_id=rtrim(a.patient_id), " +
|
|
|
- " times =a.times, " +
|
|
|
- " receipt_no=a.receipt_no, " +
|
|
|
- " order_no=a.order_no, " +
|
|
|
- " item_no=a.item_no, " +
|
|
|
- " charge_code=a.order_code, " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " je =0.00, " +
|
|
|
- " serial_no =a.serial_no, " +
|
|
|
- " confirm_time=a.confirm_time, " +
|
|
|
- " confirm_id =a.confirm_id, " +
|
|
|
- " confirm_id_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = confirm_id)," +
|
|
|
- " exec_dept =a.exec_dept, " +
|
|
|
- " exec_dept_name = (select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.exec_dept), " +
|
|
|
- " confirm_flag=isnull(a.confirm_flag,'0'), " +
|
|
|
- " req_no =a.req_no " +
|
|
|
- "FROM mz_yj_req a ,jc_zd_item b " +
|
|
|
- "where a.patient_id =#{patientId} and " +
|
|
|
- " a.times =#{times} and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.order_code =b.code and " +
|
|
|
- " isnull(a.req_no,0) > 0")
|
|
|
- List<MzChargeDetail> getFeiYongXiangXi(@Param("serialNo") Integer serialNo,
|
|
|
- @Param("patientId") String patientId,
|
|
|
- @Param("times") Integer times);
|
|
|
+ @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(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);
|
|
|
|
|
|
- @Select("SELECT req_no =a.req_no, " +
|
|
|
- " je =sum(round(quantity * unit_price,2)), " +
|
|
|
- " charge_date=max(a.charge_date) " +
|
|
|
- "FROM mz_charge_detail a ,zd_charge_item b " +
|
|
|
- "where a.serial_no =#{serialNo} and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.charge_item_code=b.code and " +
|
|
|
- " a.req_no > 0 " +
|
|
|
- "group by a.req_no")
|
|
|
- List<MzChargeDetail> piPiJingEr(@Param("serialNo") Integer serialNo);
|
|
|
|
|
|
/**
|
|
|
* @param patientId 门诊号
|
|
@@ -167,48 +101,15 @@ public interface MenZhengXiangMuDao {
|
|
|
* @param reqNo 申请号
|
|
|
* @return 缴费的详细信息
|
|
|
*/
|
|
|
- @Select("SELECT patient_id=a.patient_id, " +
|
|
|
- " times=a.times, " +
|
|
|
- " receipt_no=a.receipt_no, " +
|
|
|
- " order_no=a.order_no, " +
|
|
|
- " item_no=a.item_no, " +
|
|
|
- " charge_code=a.charge_item_code, " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " je =round(quantity * unit_price,2), " +
|
|
|
- " serial_no=a.serial_no, " +
|
|
|
- " confirm_time=a.confirm_time, " +
|
|
|
- " confirm_id=a.confirm_id, " +
|
|
|
- " exec_dept=a.exec_dept, " +
|
|
|
- " confirm_flag=a.confirm_flag, " +
|
|
|
- " req_no =a.req_no " +
|
|
|
- "FROM mz_charge_detail a ,zd_charge_item b " +
|
|
|
- "where a.patient_id =#{patientId} and " +
|
|
|
- " a.times =#{times} and " +
|
|
|
- " a.req_no=#{reqNo} and " +
|
|
|
- " a.pay_mark='0' and " +
|
|
|
- " a.charge_item_code=b.code")
|
|
|
+ @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);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "select req_no,confirm_flag,charge_item_code,bill_item_code,rtrim(patient_id) patient_id,times,charge_date,item_no,receipt_no,order_no from mz_charge_detail " +
|
|
|
- "where req_no in" +
|
|
|
- "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- "#{item}" +
|
|
|
- "</foreach>" +
|
|
|
- "<if test=\"patientId != null and patientId != '' \">" +
|
|
|
- " and patient_id = #{patientId} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"times !=null and times != '' \">" +
|
|
|
- " and times = #{times}" +
|
|
|
- "</if>" +
|
|
|
- "</script>")
|
|
|
- List<MzChargeDetail> genJuShenQingHuoQuMingXi(@Param("patientId") String patientId,
|
|
|
- @Param("times") Integer times,
|
|
|
- @Param("list") List<Integer> reqNos);
|
|
|
-
|
|
|
-
|
|
|
@Update("<script>" +
|
|
|
"<foreach collection='list' item='item' separator=';'> " +
|
|
|
"update mz_charge_detail " +
|