|
@@ -0,0 +1,133 @@
|
|
|
+package thyyxxk.webserver.dao.his.querydata;
|
|
|
+
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
+import thyyxxk.webserver.entity.querydata.QueryDrugsAndProjects;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 描述
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author xc
|
|
|
+ * @date 2021-04-16 16:01
|
|
|
+ */
|
|
|
+@Mapper
|
|
|
+public interface QueryDrugsAndProjectsMapper {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取科室
|
|
|
+ * @return 返回code和 name
|
|
|
+ * */
|
|
|
+ @Select("select code,rtrim(name)name from zy_ward_code")
|
|
|
+ List<GetDropdownBox> getWard();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取收费类型
|
|
|
+ * @return 返回code 和 name
|
|
|
+ * */
|
|
|
+ @Select("select code,rtrim(name)name from zd_charge_class")
|
|
|
+ List<GetDropdownBox> getChergeClass();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询收费项目
|
|
|
+ * @param param 传入查询条件 时间范围 科室 费用类型 收费编码
|
|
|
+ * @return 返回
|
|
|
+ * */
|
|
|
+ @Select("<script>" +
|
|
|
+ "select a.charge_code_mx chargeCode,b.name name,sum(a.charge_amount) number,sum(charge_fee) amountOfMoney,classCode=c.name,source='住院'\n" +
|
|
|
+ "from zy_detail_charge a\n" +
|
|
|
+ "left join zd_charge_item b on a.charge_code_mx=b.code\n" +
|
|
|
+ "left join zd_charge_class c on b.class_code=c.code\n" +
|
|
|
+ "where " +
|
|
|
+ "1=1 " +
|
|
|
+ "<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
+ "and charge_date>=#{startTime} and charge_date<#{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"classCode!=null and classCode!=''\">" +
|
|
|
+ "and b.class_code=#{classCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"ward!=null and ward!=''\">" +
|
|
|
+ "and a.exec_unit=#{ward} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"chargeCode!=null and chargeCode!=''\">" +
|
|
|
+ "and charge_code_mx=#{chargeCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "GROUP BY a.charge_code_mx,b.name,c.name\n" +
|
|
|
+ "union all\n" +
|
|
|
+ "select a.charge_item_code chargeCode,b.name name,sum(a.quantity*drug_win) amountOfMoney,sum(a.quantity*drug_win*unit_price) amountOfMoney,\n" +
|
|
|
+ "classCode=c.name,source='住院'\n" +
|
|
|
+ "from mz_charge_detail_b a left join zd_charge_item b on a.charge_item_code=b.code\n" +
|
|
|
+ "left join zd_charge_class c on b.class_code=c.code\n" +
|
|
|
+ "where " +
|
|
|
+ "1=1 " +
|
|
|
+ "<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
+ "and a.charge_date>=#{startTime} and a.charge_date<#{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"classCode!=null and classCode!=''\">" +
|
|
|
+ "and b.class_code=#{classCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"ward!=null and ward!=''\">" +
|
|
|
+ "and a.exec_dept=#{ward} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"chargeCode!=null and chargeCode!=''\">" +
|
|
|
+ "and a.charge_item_code=#{chargeCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "and a.pay_mark='0'\n" +
|
|
|
+ "group by a.charge_item_code,a.serial,b.name,c.name" +
|
|
|
+ "</script>")
|
|
|
+ List<QueryDrugsAndProjects> queryProjects(QueryDrugsAndProjects param);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select a.charge_code_mx chargeCode," +
|
|
|
+ "case a.serial when '01' then '药品(小)' when '99' then '药品(大)' end packageSpecification," +
|
|
|
+ "b.name name,sum(a.charge_amount) number,sum(charge_fee) amountOfMoney,source='住院',classCode=c.name\n" +
|
|
|
+ "from zy_detail_charge a,yp_zd_dict b,yp_zd_drug_kind c\n" +
|
|
|
+ "where " +
|
|
|
+ "1=1 " +
|
|
|
+ "<if test=\"startTime!=null and startTime!=''\">" +
|
|
|
+ "and charge_date>=#{startTime} and charge_date<#{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"kssFlag!=null\">" +
|
|
|
+ "and b.kss_flag=#{kssFlag} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"categoriesFlag!=null\">" +
|
|
|
+ "and b.categories_flag=#{categoriesFlag} " +
|
|
|
+ "</if>" +
|
|
|
+ " and a.charge_code_mx=b.code and a.serial=b.serial " +
|
|
|
+ " and b.drug_kind=c.code " +
|
|
|
+ "<if test=\"drugCode!=null and drugCode!=''\">" +
|
|
|
+ "and b.code=#{drugCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "GROUP BY a.charge_code_mx,a.serial,b.name,c.name\n" +
|
|
|
+ "union all\n" +
|
|
|
+ "select a.charge_item_code chargeCode," +
|
|
|
+ "case a.serial when '01' then '药品(小)' when '99' then '药品(大)' end packageSpecification," +
|
|
|
+ "b.name name,sum(a.quantity*drug_win) number,sum(a.quantity*drug_win*unit_price) amountOfMoney,source='门诊',classCode=c.name\n" +
|
|
|
+ "from mz_charge_detail_b a,yp_zd_dict b,yp_zd_drug_kind c\n" +
|
|
|
+ "where " +
|
|
|
+ "1=1 " +
|
|
|
+ "<if test=\"startTime!='' and startTime!=null\">" +
|
|
|
+ "and a.charge_date>=#{startTime} and a.charge_date<#{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"kssFlag!=null\">" +
|
|
|
+ "and b.kss_flag=#{kssFlag} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"categoriesFlag!=null\">" +
|
|
|
+ "and b.categories_flag=#{categoriesFlag} " +
|
|
|
+ "</if>" +
|
|
|
+ "and a.charge_item_code=b.code\n" +
|
|
|
+ "and a.serial=b.serial\n" +
|
|
|
+ "and a.pay_mark='0'\n" +
|
|
|
+ "and b.drug_kind=c.code\n" +
|
|
|
+ "<if test=\"drugCode!=null and drugCode!='' \">" +
|
|
|
+ "and b.code=#{drugCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "group by a.charge_item_code,a.serial,b.name,c.name" +
|
|
|
+ "</script>")
|
|
|
+ List<QueryDrugsAndProjects> queryDrugs(QueryDrugsAndProjects param);
|
|
|
+}
|