|
@@ -1,6 +1,8 @@
|
|
|
package thyyxxk.webserver.dao.his.querydata;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
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.querydata.QueryDrugsAndProjects;
|
|
@@ -41,12 +43,10 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
* @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='住院' " +
|
|
|
- "from zy_detail_charge a " +
|
|
|
- "left join zd_charge_item b on a.charge_code_mx=b.code " +
|
|
|
- "left join zd_charge_class c on b.class_code=c.code " +
|
|
|
- "where " +
|
|
|
- "1=1 " +
|
|
|
+ "select a.charge_code_mx chargeCode,b.name name,sum(a.charge_amount) number,sum(charge_fee) amount_of_money, " +
|
|
|
+ " classCode=c.name,source='住院' " +
|
|
|
+ "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} " +
|
|
|
"</if>" +
|
|
@@ -61,12 +61,10 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"</if>" +
|
|
|
"GROUP BY a.charge_code_mx,b.name,c.name " +
|
|
|
"union all " +
|
|
|
- "select a.charge_item_code chargeCode,b.name name,sum(a.quantity*drug_win) amountOfMoney,sum(a.quantity*drug_win*unit_price) amountOfMoney, " +
|
|
|
- "classCode=c.name,source='住院' " +
|
|
|
- "from mz_charge_detail_b a left join zd_charge_item b on a.charge_item_code=b.code " +
|
|
|
- "left join zd_charge_class c on b.class_code=c.code " +
|
|
|
- "where " +
|
|
|
- "1=1 " +
|
|
|
+ "select a.charge_item_code chargeCode,b.name name,sum(a.quantity*drug_win) amount_of_money, " +
|
|
|
+ " sum(a.quantity*drug_win*unit_price) amountOfMoney, classCode=c.name,source='门诊' " +
|
|
|
+ "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} " +
|
|
|
"</if>" +
|
|
@@ -79,12 +77,28 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"<if test=\"chargeCode!=null and chargeCode!=''\">" +
|
|
|
"and a.charge_item_code=#{chargeCode} " +
|
|
|
"</if>" +
|
|
|
- "and a.pay_mark='0' " +
|
|
|
+ " and a.pay_mark='0' " +
|
|
|
"group by a.charge_item_code,a.serial,b.name,c.name" +
|
|
|
"</script>")
|
|
|
List<QueryDrugsAndProjects> queryProjects(QueryDrugsAndProjects param);
|
|
|
|
|
|
|
|
|
+ @Select("select * from (" +
|
|
|
+ "select a.inpatient_no code,a.admiss_times times,rtrim(b.name) name,source='住院',rtrim(c.name) xm_name,charge_date charge_date,a.charge_amount number," +
|
|
|
+ "a.charge_fee amount_of_money,charge_code_mx charge_code " +
|
|
|
+ "from zy_detail_charge a,a_patient_mi b,zd_charge_item c " +
|
|
|
+ "where a.inpatient_no = b.inpatient_no and a.charge_code_mx = c.code and charge_code_mx = #{chargeCode} and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "union all " +
|
|
|
+ "select a.patient_id code,a.times times,rtrim(b.name) name,source='门诊',rtrim(c.name) xm_name,a.charge_date charge_date,a.quantity * a.drug_win number," +
|
|
|
+ "a.quantity*drug_win*unit_price amount_of_money,charge_item_code charge_code " +
|
|
|
+ "from mz_charge_detail a,mz_patient_mi b,zd_charge_item c " +
|
|
|
+ "where a.patient_id = b.patient_id and a.charge_item_code = c.code and charge_item_code = #{chargeCode} and charge_date >= #{startTime} and charge_date <= #{endTime}) temp")
|
|
|
+ List<QueryDrugsAndProjects> queryXiangMuShiYongHuanZhe(IPage<QueryDrugsAndProjects> page,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("chargeCode") String chargeCode);
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 查询药品
|
|
|
*
|
|
@@ -139,4 +153,29 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"group by a.charge_item_code,a.serial,b.name,c.name" +
|
|
|
"</script>")
|
|
|
List<QueryDrugsAndProjects> queryDrugs(QueryDrugsAndProjects param);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select * from (" +
|
|
|
+ "select a.inpatient_no code,admiss_times times,rtrim(b.name) name,source='住院',rtrim(c.name) xm_name,charge_date charge_date,a.charge_amount number," +
|
|
|
+ "a.charge_fee amount_of_money,charge_code_mx charge_code " +
|
|
|
+ "from zy_detail_charge a,a_patient_mi b ,yp_zd_dict c " +
|
|
|
+ "where a.charge_code_mx = c.code and a.inpatient_no = b.inpatient_no and charge_date >= #{startTime} and charge_date <= #{endTime} and a.charge_code_mx = #{chargeCode} " +
|
|
|
+ "union all " +
|
|
|
+ "select a.patient_id code,a.times times,rtrim(b.name) name,source='门诊',rtrim(c.name) xm_name,charge_date charge_date," +
|
|
|
+ "a.quantity * a.drug_win number,a.quantity*drug_win*unit_price amount_of_money, " +
|
|
|
+ "charge_item_code charge_code " +
|
|
|
+ "from mz_charge_detail_b a,mz_patient_mi b ,yp_zd_dict c " +
|
|
|
+ "where a.patient_id = b.patient_id and a.charge_item_code = c.code and charge_date >= #{startTime} and charge_date <= #{endTime} and a.charge_item_code = #{chargeCode}) temp ")
|
|
|
+ IPage<QueryDrugsAndProjects> chaKanYaoPinShiYong(IPage<QueryDrugsAndProjects> page,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("chargeCode") String chargeCode);
|
|
|
+
|
|
|
+ @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);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|