|
@@ -9,14 +9,19 @@ import java.util.List;
|
|
|
|
|
|
@Mapper
|
|
|
public interface MedicineManagementDao {
|
|
|
+
|
|
|
+ @Select("select rtrim(code) from zd_unit_code where parent_code=#{code} ")
|
|
|
+ List<String> selectChildDepartments(String code);
|
|
|
+
|
|
|
@Select("select b.code as chargeCode,sum(a.amount) as amount,sum(a.charge_fee) as chargeFee, " +
|
|
|
"max(b.pack_retprice) as price,max(a.exec_unit) as execUnit,b.serial as serialNo, " +
|
|
|
"max(a.group_no) as groupNo,max(a.page_no) as pageNo,max(b.name) as drugName, " +
|
|
|
"max(b.specification) as spec,max(a.confirm_flag) as confirmFlag,max(b.drug_flag) as drugFlag " +
|
|
|
"from zy_drug a with(nolock),yp_zd_dict b with(nolock) " +
|
|
|
"where isnull(a.page_no,0)=0 and charge_date>=#{start} and charge_date<=#{end} " +
|
|
|
- "and isnull(confirm_flag,'0')='0' and a.group_no='73' and a.exec_unit=#{dept} and a.charge_code=b.code " +
|
|
|
- "and isnull(a.serial,'01')=b.serial group by b.code,b.serial having sum(a.amount)!=0")
|
|
|
+ "and isnull(confirm_flag,'0')='0' and a.group_no='73' and a.exec_unit in (${dept}) " +
|
|
|
+ "and a.charge_code=b.code and isnull(a.serial,'01')=b.serial " +
|
|
|
+ "group by b.code,b.serial having sum(a.amount)!=0")
|
|
|
List<MedicinePage> selectMedicinePages(FetchMedicines params);
|
|
|
|
|
|
@Select("select b.code as chargeCode,rtrim(c.name) as patName,rtrim(c.inpatient_no) as patNo,sum(a.amount) as amount, " +
|
|
@@ -24,7 +29,7 @@ public interface MedicineManagementDao {
|
|
|
"b.serial as serialNo,max(a.group_no) as groupNo,max(a.page_no) as pageNo,max(b.name) as drugName, " +
|
|
|
"max(b.specification) as spec,max(a.confirm_flag) as confirmFlag,max(b.drug_flag) as drugFlag " +
|
|
|
"from zy_drug a with(nolock),yp_zd_dict b with(nolock),zy_actpatient c with(nolock) " +
|
|
|
- "where charge_date>=#{start} and charge_date<=#{end} and a.group_no='73' and a.exec_unit=#{dept} " +
|
|
|
+ "where charge_date>=#{start} and charge_date<=#{end} and a.group_no='73' and a.exec_unit in (${dept}) " +
|
|
|
"and a.charge_code=b.code and a.inpatient_no=c.inpatient_no and isnull(a.serial,'01')=b.serial " +
|
|
|
"group by b.code,b.serial,c.inpatient_no,c.name,a.charge_date having sum(a.amount)!=0")
|
|
|
List<MedicinePage> selectUsedMedicines(FetchMedicines params);
|