|  | @@ -276,7 +276,16 @@ public interface MzChargeDetailMapper {
 | 
	
		
			
				|  |  |              "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
 | 
	
		
			
				|  |  |              "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
 | 
	
		
			
				|  |  |              "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx ",
 | 
	
		
			
				|  |  | -            "from dbo.mz_charge_detail where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER} and pay_mark=#{payMark,jdbcType=CHAR} order by order_no desc",
 | 
	
		
			
				|  |  | +            "from dbo.mz_charge_detail where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER}" +
 | 
	
		
			
				|  |  | +                    "<choose>" +
 | 
	
		
			
				|  |  | +                    "<when test='payMark!=null and payMark ==0 '>",
 | 
	
		
			
				|  |  | +            " and pay_mark=#{payMark,jdbcType=CHAR}  and confirm_flag <![CDATA[<>]]> 4 ",
 | 
	
		
			
				|  |  | +            "</when>",
 | 
	
		
			
				|  |  | +            "<otherwise>" +
 | 
	
		
			
				|  |  | +                    " and pay_mark=#{payMark,jdbcType=CHAR} " +
 | 
	
		
			
				|  |  | +                    "</otherwise>" +
 | 
	
		
			
				|  |  | +                    "</choose>" +
 | 
	
		
			
				|  |  | +                    "order by order_no desc",
 | 
	
		
			
				|  |  |              "</script>"})
 | 
	
		
			
				|  |  |      List<MzChargeDetail> selectMzChargeDetailByPatientId(@Param("patientId") String patientId, @Param("times") Integer times, @Param("payMark") String payMark);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -735,8 +744,7 @@ public interface MzChargeDetailMapper {
 | 
	
		
			
				|  |  |      String selectJZName(@Param("patientId") String patientId, @Param("times") Integer times);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | -     *
 | 
	
		
			
				|  |  | -     * @param thmzmxsrParamsVo  caseType = 1 申请科室核算报表  0 执行科室核算报表
 | 
	
		
			
				|  |  | +     * @param thmzmxsrParamsVo caseType = 1 申请科室核算报表  0 执行科室核算报表
 | 
	
		
			
				|  |  |       * @return
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @Select({"<script>",
 | 
	
	
		
			
				|  | @@ -773,13 +781,13 @@ public interface MzChargeDetailMapper {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  //                    "          and isnull(a.dept_no,'') like '%' " +
 | 
	
		
			
				|  |  |                      "<when test='execDept!=null'>",
 | 
	
		
			
				|  |  | -                    "          and ( case '1' when #{caseType} then " +
 | 
	
		
			
				|  |  | +            "          and ( case '1' when #{caseType} then " +
 | 
	
		
			
				|  |  |                      "      case when isnull(a.warn_dept,'')='' then  a.exec_dept else a.warn_dept end " +
 | 
	
		
			
				|  |  |                      "      else  " +
 | 
	
		
			
				|  |  |                      "     case when isnull(a.exec_dept,'') ='' then a.warn_dept else a.exec_dept end " +
 | 
	
		
			
				|  |  |                      "  end " +
 | 
	
		
			
				|  |  |                      ") =#{execDept} " +
 | 
	
		
			
				|  |  | -                     "</when>"       +
 | 
	
		
			
				|  |  | +                    "</when>" +
 | 
	
		
			
				|  |  |                      "group by " +
 | 
	
		
			
				|  |  |                      "z.name,c.audit_code,isnull(a.group_no,'00')," +
 | 
	
		
			
				|  |  |                      " case a.charge_bill_code when 'BILL10' then 'BILL01' when 'BILL11' then 'BILL28' when 'BILL12' then 'BILL02' else a.charge_bill_code end" +
 |