|
@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
import thyyxxk.webserver.entity.datamodify.YzActOrder;
|
|
|
+import thyyxxk.webserver.entity.yibao.patient.Patient;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -24,34 +25,49 @@ public interface QueRenYiZhuShouFeiDao {
|
|
|
List<String> getKeShiLieBiao(String deptCode);
|
|
|
|
|
|
@Select("<script>" +
|
|
|
- "SELECT a.inpatient_no, " +
|
|
|
- " a.admiss_times, " +
|
|
|
- " bed_no =b.bed_no, " +
|
|
|
- " b.name, " +
|
|
|
- " a.ward_code , " +
|
|
|
- " ward_name = (select name from zd_unit_code where code = ward_code) " +
|
|
|
- "FROM yz_zy_patient_fee a ,zy_actpatient b " +
|
|
|
- "where a.charge_status='3' and " +
|
|
|
- " a.exec_unit in" +
|
|
|
+ "select " +
|
|
|
+ "rtrim(a.inpatient_no) inpatient_no, a.admiss_times, bed_no =b.bed_no,rtrim(b.name) name, a.ward_code ,b.sex,b.admiss_date, " +
|
|
|
+ "ledger_sn = (select max(ledger_sn) from zy_ledger_file where zy_ledger_file.inpatient_no = b.inpatient_no " +
|
|
|
+ "and zy_ledger_file.admiss_times = b.admiss_times),b.total_charge, " +
|
|
|
+ "responce_type_name = (select rtrim(name) from zy_zd_responce_type where zy_zd_responce_type.code = b.responce_type), " +
|
|
|
+ "ward_name = (select name from zd_unit_code where code = ward_code), " +
|
|
|
+ "shi_fou_you_chu_yuan_yi_zhu = " +
|
|
|
+ "case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
+ "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
+ "then 1 " +
|
|
|
+ "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
+ "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
+ "then 1 else 0 end " +
|
|
|
+ "FROM yz_zy_patient_fee a left join zy_actpatient b on (a.inpatient_no = b.inpatient_no and a.admiss_times = b.admiss_times) " +
|
|
|
+ "where a.charge_status ${liShi}'3' and a.exec_unit in " +
|
|
|
"<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
" #{item} " +
|
|
|
"</foreach>" +
|
|
|
- " and a.inpatient_no=b.inpatient_no and " +
|
|
|
"<if test=\"inpatientNo !=null and inpatientNo != '' \">" +
|
|
|
- " a.inpatient_no = #{inpatientNo} and " +
|
|
|
+ " and a.inpatient_no = #{inpatientNo} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"wardCode !=null and wardCode != '' \">" +
|
|
|
- " a.ward_code = #{wardCode} and " +
|
|
|
+ " and a.ward_code = #{wardCode} " +
|
|
|
"</if>" +
|
|
|
- " a.admiss_times=b.admiss_times " +
|
|
|
- " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
- "group by a.inpatient_no, a.admiss_times, b.bed_no, b.name, a.ward_code " +
|
|
|
- "order by ward_code" +
|
|
|
+ "<choose>" +
|
|
|
+ "<when test=\"startTime != null and startTime != '' \">" +
|
|
|
+ " and a.occ_time >= #{startTime} and a.occ_time <= #{endTime} " +
|
|
|
+ "</when >" +
|
|
|
+ "<otherwise>" +
|
|
|
+ " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
+ "</otherwise>" +
|
|
|
+ "</choose>" +
|
|
|
+ "group by a.inpatient_no, a.admiss_times, b.bed_no, b.name, a.ward_code, b.total_charge, b.sex, b.admiss_date,b.inpatient_no,b.admiss_times,b.responce_type " +
|
|
|
+ "order by ${fenLei}" +
|
|
|
"</script>")
|
|
|
IPage<YzActOrder> getXuQueFeiYiZhu(IPage<YzActOrder> page,
|
|
|
@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("wardCode") String wardCode,
|
|
|
- @Param("list") List<String> list);
|
|
|
+ @Param("list") List<String> list,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("fenLei") String fenLei,
|
|
|
+ @Param("liShi") String liShi);
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -62,64 +78,85 @@ public interface QueRenYiZhuShouFeiDao {
|
|
|
*/
|
|
|
@Select("<script>" +
|
|
|
"select count(*) from (" +
|
|
|
- "SELECT a.inpatient_no, " +
|
|
|
- " a.admiss_times, " +
|
|
|
- " bed_no =b.bed_no, " +
|
|
|
- " b.name, " +
|
|
|
- " a.ward_code , " +
|
|
|
- " ward_name = (select name from zd_unit_code where code = ward_code) " +
|
|
|
- "FROM yz_zy_patient_fee a ,zy_actpatient b " +
|
|
|
- "where a.charge_status='3' and " +
|
|
|
- " a.exec_unit in" +
|
|
|
+ "select " +
|
|
|
+ "a.inpatient_no, a.admiss_times, bed_no =b.bed_no, b.name, a.ward_code ,b.sex,b.admiss_date, " +
|
|
|
+ "ledger_sn = (select max(ledger_sn) from zy_ledger_file where zy_ledger_file.inpatient_no = b.inpatient_no " +
|
|
|
+ "and zy_ledger_file.admiss_times = b.admiss_times),b.total_charge, " +
|
|
|
+ "responce_type_name = (select rtrim(name) from zy_zd_responce_type where zy_zd_responce_type.code = b.responce_type), " +
|
|
|
+ "ward_name = (select name from zd_unit_code where code = ward_code), " +
|
|
|
+ "shi_fou_you_chu_yuan_yi_zhu = " +
|
|
|
+ "case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
+ "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
+ "then 1 " +
|
|
|
+ "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
|
|
|
+ "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
|
|
|
+ "then 1 else 0 end " +
|
|
|
+ "FROM yz_zy_patient_fee a left join zy_actpatient b on (a.inpatient_no = b.inpatient_no and a.admiss_times = b.admiss_times) " +
|
|
|
+ "where a.charge_status ${liShi} '3' and a.exec_unit in " +
|
|
|
"<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
" #{item} " +
|
|
|
"</foreach>" +
|
|
|
-
|
|
|
- " and a.inpatient_no=b.inpatient_no and " +
|
|
|
"<if test=\"inpatientNo !=null and inpatientNo != '' \">" +
|
|
|
- " a.inpatient_no = #{inpatientNo} and " +
|
|
|
+ " and a.inpatient_no = #{inpatientNo} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"wardCode !=null and wardCode != '' \">" +
|
|
|
- " a.ward_code = #{wardCode} and " +
|
|
|
+ " and a.ward_code = #{wardCode} " +
|
|
|
"</if>" +
|
|
|
- " a.admiss_times=b.admiss_times " +
|
|
|
- " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
- "group by a.inpatient_no, a.admiss_times, b.bed_no, b.name, a.ward_code" +
|
|
|
- ") temp" +
|
|
|
+ "<choose>" +
|
|
|
+ "<when test=\"startTime != null and startTime != '' \">" +
|
|
|
+ " and a.occ_time >= #{startTime} and a.occ_time <= #{endTime} " +
|
|
|
+ "</when >" +
|
|
|
+ "<otherwise>" +
|
|
|
+ " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
+ "</otherwise>" +
|
|
|
+ "</choose>" +
|
|
|
+ "group by a.inpatient_no, a.admiss_times, b.bed_no, b.name, a.ward_code, b.total_charge, b.sex, b.admiss_date,b.inpatient_no," +
|
|
|
+ "b.admiss_times,b.responce_type" +
|
|
|
+ ") temp " +
|
|
|
"</script>")
|
|
|
long getXuQueFeiYiZhuTotal(@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("wardCode") String wardCode,
|
|
|
- @Param("list") List<String> list);
|
|
|
-
|
|
|
-
|
|
|
- @Select("select inpatient_no,admiss_times,bed_no,sex,admiss_date,responce_type, " +
|
|
|
- "ledger_sn = (select max(ledger_sn) from zy_ledger_file where zy_ledger_file.inpatient_no = zy_actpatient.inpatient_no " +
|
|
|
- "and zy_ledger_file.admiss_times = zy_actpatient.admiss_times), " +
|
|
|
- "responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type), " +
|
|
|
- "total_charge from zy_actpatient where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} ")
|
|
|
- YzActOrder huoQuGeRenXinXi(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes);
|
|
|
+ @Param("list") List<String> list,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("liShi") String liShi);
|
|
|
|
|
|
@Select("<script>" +
|
|
|
- "select a.charge_status,e.name docotr_name,a.act_order_no,c.name order_name,a.charge_code,a.charge_fee,a.order_count,occ_time " +
|
|
|
- "from yz_zy_patient_fee a ,zd_charge_item c,yz_act_order d,a_employee_mi e " +
|
|
|
- "where a.inpatient_no = #{inpatientNo} and a.admiss_times = #{admissTimes} and " +
|
|
|
- "a.charge_status = '3' and " +
|
|
|
- "a.charge_code=c.code and " +
|
|
|
- "a.inpatient_no=d.inpatient_no and " +
|
|
|
- "a.admiss_times=d.admiss_times and " +
|
|
|
- "a.act_order_no=d.act_order_no and " +
|
|
|
- "d.physician*=e.code and " +
|
|
|
- "convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) and " +
|
|
|
- "a.exec_unit in " +
|
|
|
+ "select a.charge_status,e.name docotr_name,a.act_order_no,c.name charge_name,a.charge_code,a.charge_fee," +
|
|
|
+ "a.order_count,occ_time,rtrim(a.inpatient_no) inpatient_no,op_id,a.op_date, " +
|
|
|
+ "a.admiss_times" +
|
|
|
+ "<if test=\"startTime != null and startTime != '' \"> " +
|
|
|
+ ",op_id_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = a.op_id)," +
|
|
|
+ "a.op_date" +
|
|
|
+ "</if>" +
|
|
|
+ "from yz_zy_patient_fee a left join zd_charge_item c on (a.charge_code=c.code)\n" +
|
|
|
+ "left join yz_act_order d on (a.inpatient_no=d.inpatient_no and a.admiss_times=d.admiss_times and a.act_order_no=d.act_order_no )\n" +
|
|
|
+ "left join a_employee_mi e on (d.physician=e.code)" +
|
|
|
+ "where " +
|
|
|
+ "a.charge_status ${liShi} '3' " +
|
|
|
+ "<choose>" +
|
|
|
+ "<when test=\"startTime != null and startTime != '' \">" +
|
|
|
+ " and a.occ_time >= #{startTime} and a.occ_time <= #{endTime} " +
|
|
|
+ "</when >" +
|
|
|
+ "<otherwise>" +
|
|
|
+ " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
+ "</otherwise>" +
|
|
|
+ "</choose>" +
|
|
|
+ "and a.exec_unit in " +
|
|
|
"<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
" #{item} " +
|
|
|
"</foreach>" +
|
|
|
+ "and a.inpatient_no in " +
|
|
|
+ "<foreach collection='inpatientNoList' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ " #{item.inpatientNo} " +
|
|
|
+ "</foreach>" +
|
|
|
"</script>")
|
|
|
- List<YzActOrder> getXuQueFeiXiangXiXinXi(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("execUnit") String execUnit,
|
|
|
- @Param("list") List<String> list);
|
|
|
+ List<YzActOrder> getXuQueFeiXiangXiXinXi(@Param("list") List<String> list,
|
|
|
+ @Param("inpatientNoList") List<YzActOrder> inpatientNoList,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("liShi") String liShi);
|
|
|
+
|
|
|
|
|
|
@Update("<script>" +
|
|
|
"<foreach collection='list' item='item' separator=';'>" +
|
|
@@ -128,11 +165,54 @@ public interface QueRenYiZhuShouFeiDao {
|
|
|
" charge_status = #{item.chargeStatus}, op_id = #{code}, op_date = GETDATE() " +
|
|
|
"</set>" +
|
|
|
"WHERE act_order_no = #{item.actOrderNo} " +
|
|
|
- "AND inpatient_no = #{inpatientNo} AND admiss_times = #{admissTimes} and occ_time = #{item.occTime} " +
|
|
|
+ "AND inpatient_no = #{item.inpatientNo} AND admiss_times = #{item.admissTimes} and occ_time = #{item.occTime} " +
|
|
|
"</foreach>" +
|
|
|
"</script>")
|
|
|
- void baoCunYiZhuQueFei(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("list") List<YzActOrder> list,
|
|
|
+ void baoCunYiZhuQueFei(@Param("list") List<YzActOrder> list,
|
|
|
@Param("code") String code);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select rtrim(a.inpatient_no) inpatient_no,a.admiss_times,rtrim(e.name) patient_name, " +
|
|
|
+ "a.charge_status,docotr_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = d.physician), " +
|
|
|
+ "a.act_order_no,c.name order_name,a.charge_code,a.charge_fee,a.order_count,occ_time, " +
|
|
|
+ "op_id_name = (select rtrim(name) name from a_employee_mi where a_employee_mi.code = a.op_id), " +
|
|
|
+ "a.op_date,rtrim(f.name) ward_name " +
|
|
|
+ "from yz_zy_patient_fee a " +
|
|
|
+ "left join zd_charge_item c on (a.charge_code=c.code) " +
|
|
|
+ "left join yz_act_order d on (a.inpatient_no=d.inpatient_no and a.admiss_times=d.admiss_times and a.act_order_no=d.act_order_no) " +
|
|
|
+ "left join zy_actpatient e on (a.inpatient_no = e.inpatient_no) " +
|
|
|
+ "left join zd_unit_code f on (a.ward_code = f.code) " +
|
|
|
+ "where a.charge_status <> '3' " +
|
|
|
+ "<choose>" +
|
|
|
+ "<when test=\"startTime != null and startTime != '' \">" +
|
|
|
+ " and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "</when >" +
|
|
|
+ "<otherwise>" +
|
|
|
+ " and convert(varchar(20),a.occ_time,23)<=convert(varchar(20),getdate(),23) " +
|
|
|
+ "</otherwise>" +
|
|
|
+ "</choose>" +
|
|
|
+ " and a.exec_unit in " +
|
|
|
+ "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ " #{item} " +
|
|
|
+ "</foreach>" +
|
|
|
+ "<if test=\"wardCode !=null and wardCode != '' \">" +
|
|
|
+ " and a.ward_code = #{wardCode}" +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"yiQueFeiShuJu != null and yiQueFeiShuJu.size > 0 \">" +
|
|
|
+ " and a.inpatient_no in " +
|
|
|
+ "<foreach collection='yiQueFeiShuJu' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ " #{item.inpatientNo} " +
|
|
|
+ "</foreach>" +
|
|
|
+ "</if>" +
|
|
|
+ "order by a.ward_code" +
|
|
|
+ "</script>")
|
|
|
+ List<YzActOrder> huoQuLiShiQueFeiXinXi(
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("list") List<String> execUnitList,
|
|
|
+ @Param("wardCode") String wardCode,
|
|
|
+ @Param("yiQueFeiShuJu") List<Patient> yiQueFeiShuJu);
|
|
|
+
|
|
|
+
|
|
|
}
|