|  | @@ -15,6 +15,7 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Map;
 | 
	
		
			
				|  |  |  import java.util.Set;
 | 
	
		
			
				|  |  |  import java.util.stream.Stream;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -727,10 +728,37 @@ public interface YiZhuLuRuDao {
 | 
	
		
			
				|  |  |              "from yz_act_order " +
 | 
	
		
			
				|  |  |              "where inpatient_no = #{patNo} " +
 | 
	
		
			
				|  |  |              "  and admiss_times = #{times} " +
 | 
	
		
			
				|  |  | -            "  and self_buy = '4' " +
 | 
	
		
			
				|  |  | -            "  and status_flag in ('1', '2') ")
 | 
	
		
			
				|  |  | +            "  and self_buy = '4' ")
 | 
	
		
			
				|  |  |      int obtainTheNumberOfDischargedDrugs(String patNo, Integer times);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Select("select day_800, day_830, day_900,\n" +
 | 
	
		
			
				|  |  | +            "       day_930, day_1000, day_1030, day_1100, day_1130, day_1200, day_1230, day_1300, day_1330,\n" +
 | 
	
		
			
				|  |  | +            "       day_1400, day_1430, day_1500, day_1530, day_1600, day_1630, day_1700, day_1730,\n" +
 | 
	
		
			
				|  |  | +            "       day_1800, day_1830, day_1900, day_1930, day_2000, day_2030, day_2100, day_2130,\n" +
 | 
	
		
			
				|  |  | +            "       day_2200, day_2230, day_2300, day_2330, day_2400, day_030, day_100, day_130, day_200,\n" +
 | 
	
		
			
				|  |  | +            "       day_230, day_300, day_330, day_400, day_430, day_500, day_530, day_600, day_630,\n" +
 | 
	
		
			
				|  |  | +            "       day_700, day_730\n" +
 | 
	
		
			
				|  |  | +            "from yz_order_frequency where code = #{code}")
 | 
	
		
			
				|  |  | +    Map<String, Short> numberOfTimesADay(String code);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 出院带药只能要这些给药方式
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param code 编码
 | 
	
		
			
				|  |  | +     * @return 返回数量
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Select("select count(1)\n" +
 | 
	
		
			
				|  |  | +            "from (select b.charge_code, a.*\n" +
 | 
	
		
			
				|  |  | +            "      from yz_supply_type a\n" +
 | 
	
		
			
				|  |  | +            "               left join yz_supply_charge b on a.supply_code = b.supply_code) aa\n" +
 | 
	
		
			
				|  |  | +            "where charge_code is null and supply_code = #{code} ")
 | 
	
		
			
				|  |  | +    int dischargeWithMedicationAdministration(String code);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update yz_act_order set drug_quan = #{item.drugQuan}," +
 | 
	
		
			
				|  |  | +            "drug_occ = #{item.drugOcc} where act_order_no = #{item.actOrderNo} ")
 | 
	
		
			
				|  |  | +    void updateThePickup(@Param("item") XinZhenYzActOrder item);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Select("select rtrim(supply_code) code,rtrim(supply_name) name " +
 | 
	
		
			
				|  |  |              "from yz_supply_type with (NOLOCK) " +
 | 
	
		
			
				|  |  |              "where ps_flag in ('1', '0')")
 | 
	
	
		
			
				|  | @@ -748,6 +776,18 @@ public interface YiZhuLuRuDao {
 | 
	
		
			
				|  |  |      List<GetDropdownBox> huoQuGeiYaoFangShi(String code);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Select("select rtrim(supply_code) code, rtrim(supply_name) name\n" +
 | 
	
		
			
				|  |  | +            "from (select b.charge_code, a.*\n" +
 | 
	
		
			
				|  |  | +            "      from yz_supply_type a\n" +
 | 
	
		
			
				|  |  | +            "               left join yz_supply_charge b on a.supply_code = b.supply_code) aa\n" +
 | 
	
		
			
				|  |  | +            "where charge_code is null\n" +
 | 
	
		
			
				|  |  | +            "  and (py_code like #{code} or d_code like #{code} or supply_name like #{code} or supply_code like #{code})")
 | 
	
		
			
				|  |  | +    List<GetDropdownBox> getCostFreeDosing(String code);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Select("SELECT a.code code, " +
 | 
	
		
			
				|  |  |              "       a.name name " +
 | 
	
		
			
				|  |  |              "FROM zd_unit_code a with (NOLOCK), " +
 | 
	
	
		
			
				|  | @@ -1503,18 +1543,24 @@ public interface YiZhuLuRuDao {
 | 
	
		
			
				|  |  |              "                           submit_name, submit_flag, " +
 | 
	
		
			
				|  |  |              "                           page_class, page_name, " +
 | 
	
		
			
				|  |  |              "                           start_date, end_date, group_no) " +
 | 
	
		
			
				|  |  | -            "values (#{pageNo}, '#{patInfo.deptCode}', #{patInfo.wardCode}, getdate()," +
 | 
	
		
			
				|  |  | +            "values (#{pageNo}, #{patInfo.deptCode}, #{patInfo.wardCode}, getdate()," +
 | 
	
		
			
				|  |  |              " #{userCode}, 1, 1, '出院带药', getdate(), getdate(), #{groupNo})")
 | 
	
		
			
				|  |  |      void summarySheetOfDrugs(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    @Insert("insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, " +
 | 
	
		
			
				|  |  | -            "  amount,\n" +
 | 
	
		
			
				|  |  | -            " retprice, charge_date, infant_flag, drawer, always_flag, status_flag/*1*/, drug_class,\n" +
 | 
	
		
			
				|  |  | +    @Insert("<script>" +
 | 
	
		
			
				|  |  | +            "insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, " +
 | 
	
		
			
				|  |  | +            "  amount, retprice/*药品的单价*/, charge_date, infant_flag, drawer, always_flag, status_flag/*1*/, drug_class,\n" +
 | 
	
		
			
				|  |  |              " serail/*0*/,\n" +
 | 
	
		
			
				|  |  |              " occ_time, act_order_no, page_no, pay_self/*0*/, serial/*serial*/,\n" +
 | 
	
		
			
				|  |  | -            " group_no, doctor_name, page_class, yb_self_flag)\n" +
 | 
	
		
			
				|  |  | -            "values ();")
 | 
	
		
			
				|  |  | -    void insertDetailedMedicineList();
 | 
	
		
			
				|  |  | +            " group_no, doctor_name, page_class)\n" +
 | 
	
		
			
				|  |  | +            "values " +
 | 
	
		
			
				|  |  | +            "<foreach collection='list' item='item' separator=','>" +
 | 
	
		
			
				|  |  | +            "(#{patInfo.inpatientNo},#{patInfo.admissTimes},#{patInfo.name},#{patInfo.bedNo},#{patInfo.deptCode},#{patInfo.wardCode},#{item.orderCode}," +
 | 
	
		
			
				|  |  | +            "#{item.drugQuan},(select pack_retprice from yp_zd_dict where code = '${item.orderCode}' and serial = '${item.serial}'),getdate(),#{patInfo.infantFlag},#{userCode}," +
 | 
	
		
			
				|  |  | +            "'a','1',#{item.drugFlag},'0',getdate(),#{item.actOrderNo},#{pageNo},'0',#{item.serial},#{groupNo},#{userCode},'1')" +
 | 
	
		
			
				|  |  | +            "</foreach>" +
 | 
	
		
			
				|  |  | +            "</script>")
 | 
	
		
			
				|  |  | +    void insertDetailedMedicineList(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo, List<XinZhenYzActOrder> list);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 |