|  | @@ -9,8 +9,8 @@ import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.login.UserInfo;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.yibao.ZyActpatient;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | -import java.util.Map;
 | 
	
		
			
				|  |  |  import java.util.Set;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -111,6 +111,32 @@ public interface PublicDao {
 | 
	
		
			
				|  |  |              "bed_no,total_charge,balance from zy_actpatient a where inpatient_no = #{inpatientNo} ")
 | 
	
		
			
				|  |  |      ZyActpatient getHuanZheJiBenXinXi(@Param("inpatientNo") String inpatientNo);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} " +
 | 
	
		
			
				|  |  | +            "and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and ori_detail_sn = -1 and charge_amount > 0")
 | 
	
		
			
				|  |  | +    void chongZhiZhenLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                             @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                             @Param("ledgerSn") Integer ledgerSn);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
 | 
	
		
			
				|  |  | +            "and ori_detail_sn is not null " +
 | 
	
		
			
				|  |  | +            "and  charge_amount < 0")
 | 
	
		
			
				|  |  | +    List<Integer> huoQuTuiFeiYuanLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                                         @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                                         @Param("ledgerSn") Integer ledgerSn);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("<script>" +
 | 
	
		
			
				|  |  | +            "update zy_detail_charge set ori_detail_sn = -1 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
 | 
	
		
			
				|  |  | +            "and charge_amount > 0 and detail_sn in " +
 | 
	
		
			
				|  |  | +            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
 | 
	
		
			
				|  |  | +            "#{item}" +
 | 
	
		
			
				|  |  | +            "</foreach>" +
 | 
	
		
			
				|  |  | +            "</script>")
 | 
	
		
			
				|  |  | +    void genXingFuLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                          @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                          @Param("ledgerSn") Integer ledgerSn,
 | 
	
		
			
				|  |  | +                          @Param("list") List<Integer> detailSnList);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " +
 | 
	
		
			
				|  |  |              "from zy_detail_charge a " +
 | 
	
		
			
				|  |  |              "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn}  and order_no <> 6 and trans_flag_yb <> 2 " +
 | 
	
	
		
			
				|  | @@ -128,10 +154,10 @@ public interface PublicDao {
 | 
	
		
			
				|  |  |              "#{sn}" +
 | 
	
		
			
				|  |  |              "</foreach>" +
 | 
	
		
			
				|  |  |              "</script>")
 | 
	
		
			
				|  |  | -    List<ZyDetailCharge> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | -                                        @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | -                                        @Param("ledgerSn") Integer ledgerSn,
 | 
	
		
			
				|  |  | -                                        @Param("oriSn") Set<Integer> oriSn);
 | 
	
		
			
				|  |  | +    List<ZyDetailCharge> getZhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                                           @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                                           @Param("ledgerSn") Integer ledgerSn,
 | 
	
		
			
				|  |  | +                                           @Param("oriSn") Set<Integer> oriSn);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Update("<script>" +
 | 
	
		
			
				|  |  |              "<foreach collection='list' item='item' separator=';'>" +
 | 
	
	
		
			
				|  | @@ -144,22 +170,27 @@ public interface PublicDao {
 | 
	
		
			
				|  |  |                                 @Param("ledgerSn") Integer ledgerSn,
 | 
	
		
			
				|  |  |                                 @Param("list") List<Integer> oriDetailSn);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Select("select isnull(sum(charge_fee),0)  from zy_detail_charge  " +
 | 
	
		
			
				|  |  | +            "where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} and trans_flag_yb=2")
 | 
	
		
			
				|  |  | +    BigDecimal zhenFuXingDiFeiYong(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                                   @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                                   @Param("ledger") Integer ledger);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update zy_detail_charge set trans_flag_yb = 0 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} and  trans_flag_yb = 2")
 | 
	
		
			
				|  |  | +    void chongXingZhengFuXiangDi(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | +                                 @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | +                                 @Param("ledger") Integer ledger);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Select("select detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn}" +
 | 
	
		
			
				|  |  |              " and ori_detail_sn = -1 and charge_amount > 0")
 | 
	
		
			
				|  |  |      List<Integer> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  |                                   @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  |                                   @Param("ledgerSn") Integer ledgerSn);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn}" +
 | 
	
		
			
				|  |  | -            " and ori_detail_sn > 0 and charge_amount < 0 group by ori_detail_sn")
 | 
	
		
			
				|  |  | -    List<Integer> fuShuLiuShui(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | -                               @Param("admissTimes") Integer admissTimes,
 | 
	
		
			
				|  |  | -                               @Param("ledgerSn") Integer ledgerSn);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @Update("<script>" +
 | 
	
		
			
				|  |  |              "update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn} " +
 | 
	
		
			
				|  |  |              "and detail_sn in " +
 | 
	
		
			
				|  |  | -            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
 | 
	
		
			
				|  |  | +            "<foreach collection='detailSn' item='item' index='index' open='(' close=')' separator=','>" +
 | 
	
		
			
				|  |  |              "#{item}" +
 | 
	
		
			
				|  |  |              "</foreach>" +
 | 
	
		
			
				|  |  |              "</script>")
 |