|
@@ -5,7 +5,9 @@ import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
+import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
|
|
|
import thyyxxk.webserver.entity.querydata.QueryDrugsAndProjects;
|
|
|
+import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -48,7 +50,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"from zy_detail_charge a , zd_charge_item b , zd_charge_class c " +
|
|
|
"where a.charge_code_mx=b.code and b.class_code=c.code " +
|
|
|
"<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
- "and charge_date>=#{startTime} and charge_date<#{endTime} " +
|
|
|
+ "and charge_date>=#{startTime} and charge_date<=#{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"classCode!=null and classCode!=''\">" +
|
|
|
"and b.class_code=#{classCode} " +
|
|
@@ -66,7 +68,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"from mz_charge_detail_b a , zd_charge_item b , zd_charge_class c " +
|
|
|
"where a.charge_item_code=b.code and b.class_code=c.code " +
|
|
|
"<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
- "and a.charge_date>=#{startTime} and a.charge_date<#{endTime} " +
|
|
|
+ "and a.charge_date>=#{startTime} and a.charge_date<=#{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"classCode!=null and classCode!=''\">" +
|
|
|
"and b.class_code=#{classCode} " +
|
|
@@ -91,7 +93,8 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
*/
|
|
|
@Select("select * from (" +
|
|
|
"SELECT " +
|
|
|
- " a.inpatient_no patient,a.admiss_times times,rtrim(b.name) name,b.social_no social_no,b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date charge_date, " +
|
|
|
+ " rtrim(a.inpatient_no) patient,a.admiss_times times,rtrim(b.name) name,b.social_no social_no," +
|
|
|
+ "b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date charge_date, " +
|
|
|
" (select name from zd_unit_code where code=c.small_dept) dept, " +
|
|
|
" (select name from zy_zd_responce_type where code=c.responce_type) yb_type, " +
|
|
|
" sum(a.charge_amount) number,sum(a.charge_fee) amount_of_money,charge_code_mx charge_code,source='住院' " +
|
|
@@ -104,7 +107,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,c.responce_type,a.charge_date " +
|
|
|
"union all " +
|
|
|
"SELECT " +
|
|
|
- " a.inpatient_no patient,a.admiss_times times,rtrim(b.name) name ,b.social_no social_no,b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date, " +
|
|
|
+ " rtrim(a.inpatient_no) patient,a.admiss_times times,rtrim(b.name) name ,b.social_no social_no,b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date, " +
|
|
|
" (select name from zd_unit_code where code=c.small_dept) dept, " +
|
|
|
" (select name from zy_zd_responce_type where code=c.responce_type) yb_type, " +
|
|
|
" sum(a.charge_amount) number,sum(a.charge_fee) amount_of_money,charge_code_mx charge_code,source = '住院' " +
|
|
@@ -116,7 +119,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
" and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
"group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,c.responce_type,a.charge_date " +
|
|
|
"union all " +
|
|
|
- " select a.patient_id patient,a.times times,rtrim(b.name) name ,b.social_no social_no,b.phone_no phone,a.charge_date admiss_date,dis_date = null,a.charge_date charge_date, " +
|
|
|
+ " select rtrim(a.patient_id) patient,a.times times,rtrim(b.name) name ,b.social_no social_no,b.phone_no phone,a.charge_date admiss_date,dis_date = null,a.charge_date charge_date, " +
|
|
|
" (select name from zd_unit_code where code = a.exec_dept) dept, " +
|
|
|
" yb_type = '自费',sum(a.quantity*a.drug_win) number,sum(a.quantity*drug_win*unit_price) amount_of_money,a.charge_item_code,source = '门诊' " +
|
|
|
" from mz_charge_detail_b a,mz_patient_mi b " +
|
|
@@ -144,7 +147,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"where " +
|
|
|
"1=1 " +
|
|
|
"<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
- "and charge_date>=#{startTime} and charge_date<#{endTime} " +
|
|
|
+ "and charge_date>=#{startTime} and charge_date<=#{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"kssFlag!=null and kssFlag!=''\">" +
|
|
|
"and b.kss_flag=#{kssFlag} " +
|
|
@@ -166,7 +169,7 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"where " +
|
|
|
"1=1 " +
|
|
|
"<if test=\"startTime!='' and startTime!=null\">" +
|
|
|
- "and a.charge_date>=#{startTime} and a.charge_date<#{endTime} " +
|
|
|
+ "and a.charge_date>=#{startTime} and a.charge_date<=#{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"kssFlag!=null and kssFlag!=''\">" +
|
|
|
"and b.kss_flag=#{kssFlag} " +
|
|
@@ -220,6 +223,45 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
@Select("select rtrim(code) code,rtrim(name) name from ${tableName} where py_code like #{pyCode}")
|
|
|
List<GetDropdownBox> chaXunXiangMuhuoYaoPinCode(@Param("tableName") String tableName,
|
|
|
@Param("pyCode") String pyCode);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select rtrim(b.inpatient_no) inpatient_no,rtrim(a.name) name,a.responce_type,b.admiss_times,sum(b.charge4+b.charge6+b.charge8+b.charge9+b.charge11+b.charge18) jianChaFei," +
|
|
|
+ "sum(b.charge13) jianYanFei,sum(b.total_charge) zongFeiYong, " +
|
|
|
+ " (sum(b.charge4+b.charge6+b.charge8+b.charge9+b.charge11+b.charge18)+sum(b.charge13))/sum(b.total_charge) jcjyfzb, " +
|
|
|
+ " a.admiss_date,a.dis_date, (select name from zd_unit_code where code=a.small_dept) deptName " +
|
|
|
+ "from zy_inactpatient a,zy_ledger_file b " +
|
|
|
+ "where a.inpatient_no not like '%$%' and a.inpatient_no not like 'S%' and a.inpatient_no not like 'JT%' " +
|
|
|
+ " and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times and b.settle_type<>1 " +
|
|
|
+ "<if test=\"start !=null and start != '' \">" +
|
|
|
+ " and a.admiss_date >= #{start} and a.admiss_date <= #{end} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"responces.size > 0\" >" +
|
|
|
+ "and a.responce_type in " +
|
|
|
+ "<foreach collection='responces' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ "#{item}" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</if>" +
|
|
|
+ "group by b.inpatient_no,b.admiss_times,a.admiss_date,a.dis_date,a.small_dept,a.name,a.responce_type " +
|
|
|
+ "having (sum(b.charge4+b.charge6+b.charge8+b.charge9+b.charge11+b.charge18)+sum(b.charge13))>0 " +
|
|
|
+ "order by (sum(b.charge4+b.charge6+b.charge8+b.charge9+b.charge11+b.charge18)+sum(b.charge13))/sum(b.total_charge) desc" +
|
|
|
+ "</script>")
|
|
|
+ List<IllegalChargeData> chaXunJianYanJianCha(@Param("start") String start,
|
|
|
+ @Param("end") String end,
|
|
|
+ @Param("responces") List<String> responces);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select rtrim(inpatient_no) patient,admiss_times times,dis_diag_comment,dis_diag_no from ba_first_page1 where " +
|
|
|
+ "inpatient_no in " +
|
|
|
+ "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ "#{item.patient}" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>")
|
|
|
+ List<QueryDrugsAndProjects> queryZhenDuan(@Param("list") List<QueryDrugsAndProjects> list);
|
|
|
+
|
|
|
+
|
|
|
+ List<ZyDetailCharge> getHuanZheXinXi();
|
|
|
}
|
|
|
|
|
|
|