|  | @@ -3,8 +3,13 @@ package thyyxxk.webserver.dao.his.jiekou;
 | 
	
		
			
				|  |  |  import org.apache.ibatis.annotations.Mapper;
 | 
	
		
			
				|  |  |  import org.apache.ibatis.annotations.Param;
 | 
	
		
			
				|  |  |  import org.apache.ibatis.annotations.Select;
 | 
	
		
			
				|  |  | +import org.apache.ibatis.annotations.Update;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.jiekou.PatientInformation;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.YshYjReq;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import java.math.BigDecimal;
 | 
	
		
			
				|  |  | +import java.util.Date;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -17,41 +22,70 @@ import java.util.List;
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  @Mapper
 | 
	
		
			
				|  |  |  public interface DuiWaiJieKouDao {
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -     * 获取 门诊患者的信息
 | 
	
		
			
				|  |  | -     *
 | 
	
		
			
				|  |  | -     * @param patientId 门诊号
 | 
	
		
			
				|  |  | -     * @param execDept  执行科室
 | 
	
		
			
				|  |  | -     * @return 返回 多条数据
 | 
	
		
			
				|  |  | -     */
 | 
	
		
			
				|  |  | -    @Select("select a.patient_id,order_code order_id,a.patient_id inpatient_no,p_name name,birth_date birthday, " +
 | 
	
		
			
				|  |  | -            "group_name test_name, " +
 | 
	
		
			
				|  |  | -            "(select RTRIM(name) from zd_unit_code where code = req_ward) open_dpmt, " +
 | 
	
		
			
				|  |  | -            "(select RTRIM(name) from a_employee_mi where code = req_doctor) open_doc,req_date open_date,receive_flag, " +
 | 
	
		
			
				|  |  | -            "source = '门诊', rtrim(ic_card_no) card_id, " +
 | 
	
		
			
				|  |  | -            "case when sex = 1 then '男' when sex = 2 then '女' else '未知' end sex,RTRIM(adress) address,rtrim(social_no) idNumber, " +
 | 
	
		
			
				|  |  | -            "RTRIM(phone_no) phone,jy_remark LCZD,result_comment JYBS " +
 | 
	
		
			
				|  |  | -            "from mz_yj_req a left join mz_patient_mi b on (a.patient_id = b.patient_id) " +
 | 
	
		
			
				|  |  | -            "where exec_dept = #{execDept} and a.patient_id = #{patientId}")
 | 
	
		
			
				|  |  | -    List<PatientInformation> getMzPatient(@Param("patientId") String patientId,
 | 
	
		
			
				|  |  | -                                          @Param("execDept") String execDept);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -     * 获取 住院患者的信息
 | 
	
		
			
				|  |  | -     *
 | 
	
		
			
				|  |  | -     * @param inpatientNo 住院号
 | 
	
		
			
				|  |  | -     * @param execDept    执行科室
 | 
	
		
			
				|  |  | -     * @return 返回信息
 | 
	
		
			
				|  |  | -     */
 | 
	
		
			
				|  |  | -    @Select("select a.inpatient_no patient_id,order_code order_id,a.inpatient_no,p_name name, " +
 | 
	
		
			
				|  |  | -            "case when sex = 1 then '男' when sex = 2 then '女' else '未知' end sex,birth_date birthday, " +
 | 
	
		
			
				|  |  | -            "home_street address,rtrim(social_no) idNumber,rtrim(home_tel) phone,order_name testName, " +
 | 
	
		
			
				|  |  | -            "(select rtrim(name)  from zd_unit_code where code = req_ward) open_dpmt, " +
 | 
	
		
			
				|  |  | -            "bed_no sickbed, " +
 | 
	
		
			
				|  |  | -            "(select rtrim(name) from a_employee_mi where code = req_doctor) open_doc, " +
 | 
	
		
			
				|  |  | -            "req_date open_date,receive_flag,source='住院',req_comment JYBS,diag_text LCZD " +
 | 
	
		
			
				|  |  | -            "from ysh_yj_req a left join a_patient_mi b on (a.inpatient_no = b.inpatient_no) " +
 | 
	
		
			
				|  |  | -            "where exec_dept = #{execDept} and a.inpatient_no = #{inpatientNo} ")
 | 
	
		
			
				|  |  | -    List<PatientInformation> getYzPatient(@Param("inpatientNo") String inpatientNo,
 | 
	
		
			
				|  |  | -                                          @Param("execDept") String execDept);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Select("select patient_id, times, item_no, receipt_no, order_no, req_no " +
 | 
	
		
			
				|  |  | +            "from mz_yj_req " +
 | 
	
		
			
				|  |  | +            "where req_no = #{reqNo} " +
 | 
	
		
			
				|  |  | +            "order by req_no desc")
 | 
	
		
			
				|  |  | +    MzChargeDetail getFeeInfoByReqNo(Integer reqNo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update mz_yj_req " +
 | 
	
		
			
				|  |  | +            "set confirm_flag = #{flag}, " +
 | 
	
		
			
				|  |  | +            "    receive_flag =#{flag}, " +
 | 
	
		
			
				|  |  | +            "    confirm_time = #{date}, " +
 | 
	
		
			
				|  |  | +            "    exec_dept    = #{dept}, " +
 | 
	
		
			
				|  |  | +            "    confirm_id   = #{userId} " +
 | 
	
		
			
				|  |  | +            "where req_no = #{reqNo}")
 | 
	
		
			
				|  |  | +    int confirmOutpatientYjReq(String flag, String userId, String dept, Date date, Integer reqNo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update mz_charge_detail " +
 | 
	
		
			
				|  |  | +            "set confirm_flag = #{flag}, " +
 | 
	
		
			
				|  |  | +            "    receive_flag =#{flag}, " +
 | 
	
		
			
				|  |  | +            "    confirm_time = #{date}, " +
 | 
	
		
			
				|  |  | +            "    exec_dept    = #{dept}, " +
 | 
	
		
			
				|  |  | +            "    confirm_id   = #{userId} " +
 | 
	
		
			
				|  |  | +            "where patient_id = #{mz.patientId} " +
 | 
	
		
			
				|  |  | +            "  and times = #{mz.times} " +
 | 
	
		
			
				|  |  | +            "  and receipt_no = #{mz.receiptNo} " +
 | 
	
		
			
				|  |  | +            "  and order_no = #{mz.orderNo} " +
 | 
	
		
			
				|  |  | +            "  and req_no = #{mz.reqNo}")
 | 
	
		
			
				|  |  | +    int confirmOutPatientFee(@Param("flag") String flag,
 | 
	
		
			
				|  |  | +                             @Param("userId") String userId,
 | 
	
		
			
				|  |  | +                             @Param("dept") String dept,
 | 
	
		
			
				|  |  | +                             @Param("date") Date date,
 | 
	
		
			
				|  |  | +                             @Param("reqNo") Integer reqNo,
 | 
	
		
			
				|  |  | +                             @Param("mz") MzChargeDetail mz);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Select("select act_order_no, confirm_flag " +
 | 
	
		
			
				|  |  | +            "from ysh_yj_req where req_no = #{reqNo}")
 | 
	
		
			
				|  |  | +    YshYjReq selectedYshJyReqOne(Integer reqNo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Select("select count(1) " +
 | 
	
		
			
				|  |  | +            "from yz_zy_patient_fee where act_order_no = #{orderNo} ")
 | 
	
		
			
				|  |  | +    int whetherToGenerateAConfirmationFee(BigDecimal orderNo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update ysh_yj_req " +
 | 
	
		
			
				|  |  | +            "set confirm_flag = 1, " +
 | 
	
		
			
				|  |  | +            "    confirm_id   = #{confirmId}, " +
 | 
	
		
			
				|  |  | +            "    confirm_time = #{date}," +
 | 
	
		
			
				|  |  | +            "    exec_dept = #{deptCode} " +
 | 
	
		
			
				|  |  | +            "where req_no = #{reqNo} ")
 | 
	
		
			
				|  |  | +    int updateYshYjReqFlag(String confirmId,
 | 
	
		
			
				|  |  | +                           Integer reqNo,
 | 
	
		
			
				|  |  | +                           Date date,
 | 
	
		
			
				|  |  | +                           String deptCode);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Update("update yz_zy_patient_fee " +
 | 
	
		
			
				|  |  | +            "set charge_status = '1', " +
 | 
	
		
			
				|  |  | +            "    op_id         = #{confirmId}, " +
 | 
	
		
			
				|  |  | +            "    op_date       = #{date}," +
 | 
	
		
			
				|  |  | +            "    exec_unit     = #{deptCode} " +
 | 
	
		
			
				|  |  | +            "where act_order_no = #{orderNo} ")
 | 
	
		
			
				|  |  | +    int confirmTheIntermediateTable(String confirmId,
 | 
	
		
			
				|  |  | +                                    BigDecimal orderNo,
 | 
	
		
			
				|  |  | +                                    Date date,
 | 
	
		
			
				|  |  | +                                    String deptCode);
 | 
	
		
			
				|  |  |  }
 |