|
|
@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
+import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -19,119 +20,47 @@ public interface SurgeryArrangementDao {
|
|
|
"order by dept_code, ward_code")
|
|
|
List<GetDropdownBox> getASurgicalWard();
|
|
|
|
|
|
- @Select("SELECT record_id=a.record_id," +
|
|
|
- " op_start_date, " +
|
|
|
- " op_end_date, " +
|
|
|
- " anst_start_date," +
|
|
|
- " anst_end_date, " +
|
|
|
- " req_date = a.req_date, " +
|
|
|
- " zy_serial_no=a.zy_serial_no, " +
|
|
|
- " op_times=a.op_times, " +
|
|
|
- " patient_name=a.patient_name, " +
|
|
|
- " dept_code=a.dept_code, " +
|
|
|
- " ward_code=a.ward_code, " +
|
|
|
- " apply_date=a.apply_date, " +
|
|
|
- " apply_user=a.apply_user, " +
|
|
|
- " apply_doc=a.apply_doc, " +
|
|
|
- " schedule_date=a.schedule_date, " +
|
|
|
- " schedule_user=a.schedule_user, " +
|
|
|
- " status=a.status, " +
|
|
|
- " patient_type=a.patient_type, " +
|
|
|
- " act_order_no=a.act_order_no, " +
|
|
|
- " op_code=a.op_code, " +
|
|
|
- " op_name=a.op_name, " +
|
|
|
- " op_datetime=a.op_datetime, " +
|
|
|
- " room_code=a.room_code, " +
|
|
|
- " room_name=(select rtrim(name) from op_zd_room where op_zd_room.code = a.room_code), " +
|
|
|
- " op_group_code=a.op_group_code, " +
|
|
|
- " hocus_code=a.hocus_code, " +
|
|
|
- " hocus_name = (select rtrim(name) from zd_anaesthesia where zd_anaesthesia.code = a.hocus_code), " +
|
|
|
- " diag_before_op=a.diag_before_op, " +
|
|
|
- " diag_after_op=a.diag_after_op, " +
|
|
|
- " infection_flag=a.infection_flag, " +
|
|
|
- " urgent_clinic_flag=a.urgent_clinic_flag, " +
|
|
|
- " avocation_flag=a.avocation_flag, " +
|
|
|
- " blood_amount=a.blood_amount, " +
|
|
|
- " blood_type=a.blood_type, " +
|
|
|
- " op_stastics_id=a.op_stastics_id, " +
|
|
|
- " isolation_indicator=a.isolation_indicator, " +
|
|
|
- " op_scale=a.op_scale, " +
|
|
|
- " op_endtime=a.op_endtime, " +
|
|
|
- " diag_before_code=a.diag_before_code, " +
|
|
|
- " diag_after_code=a.diag_after_code, " +
|
|
|
- " hbsag=a.hbsag, " +
|
|
|
- " body_code=a.body_code, " +
|
|
|
- " part_code=a.part_code, " +
|
|
|
- " specialreq_code=a.specialreq_code, " +
|
|
|
- " instrument_code=a.instrument_code, " +
|
|
|
- " aspesis_scale=a.aspesis_scale, " +
|
|
|
- " remark=a.remark, " +
|
|
|
- " op_dept=a.op_dept, " +
|
|
|
- " input_id=a.input_id, " +
|
|
|
- " input_date=a.input_date, " +
|
|
|
- " req_id=a.req_id, " +
|
|
|
- " req_date=a.req_date, " +
|
|
|
- " last_modify_id=a.last_modify_id, " +
|
|
|
- " arrange_id=a.arrange_id, " +
|
|
|
- " arrange_date=a.arrange_date, " +
|
|
|
- " inpatient_no=a.inpatient_no, " +
|
|
|
- " admiss_times=a.admiss_times, " +
|
|
|
- " cancel_id=a.cancel_id, " +
|
|
|
- " cancel_time=a.cancel_time, " +
|
|
|
- " doctor_zd=b.doctor_zd, " +
|
|
|
- " doctor_zd_name = (select rtrim(name) from a_employee_mi where a_employee_mi.code = doctor_zd), " +
|
|
|
- " doctor_mz=b.doctor_mz, " +
|
|
|
- " doctor_1 =b.doctor_1, " +
|
|
|
- " doctor_2 =b.doctor_2, " +
|
|
|
- " nurse_xh =b.nurse_xh, " +
|
|
|
- " nurse_xh_name = (select rtrim(name) from a_employee_mi where a_employee_mi.code = nurse_xh), " +
|
|
|
- " nurse_qx =b.nurse_qx, " +
|
|
|
- " nurse_qx_name = (select rtrim(name) from a_employee_mi where a_employee_mi.code = nurse_qx), " +
|
|
|
- " bed_no=a.bed_no, " +
|
|
|
- " sex = case when isnull(c.sex, '') = '' then '' when c.sex = '1' then '男' else '女' end, " +
|
|
|
- " sstc=a.sstc, " +
|
|
|
- " age=case " +
|
|
|
- " when c.birth_date is null then ' ' " +
|
|
|
- " when datediff(year, c.birth_date, a.op_datetime) > 14 then " +
|
|
|
- " convert(char(2), datediff(year, c.birth_date, a.op_datetime)) + '岁' " +
|
|
|
- " when datediff(dd, c.birth_date, a.op_datetime) >= 365 then " +
|
|
|
- " convert(char(2), datediff(dd, c.birth_date, a.op_datetime) / 365) + '岁' + " +
|
|
|
- " convert(char(2), ((datediff(dd, c.birth_date, a.op_datetime) / 30) % 12)) + '月' " +
|
|
|
- " when datediff(dd, c.birth_date, a.op_datetime) < 30 then " +
|
|
|
- " convert(char(2), case datediff(dd, c.birth_date, a.op_datetime) " +
|
|
|
- " when 0 then 1 " +
|
|
|
- " else datediff(dd, c.birth_date, a.op_datetime) end) + '天' " +
|
|
|
- " else convert(char(2), datediff(dd, c.birth_date, a.op_datetime) / 30) + '月' end, " +
|
|
|
- " tw_flag=a.tw_flag, " +
|
|
|
- " doctor_mz_ys=b.doctor_mz_ys, " +
|
|
|
- " doctor_mz_ys_name=(select rtrim(name) from a_employee_mi where a_employee_mi.code = b.doctor_mz_ys), " +
|
|
|
- " doctor_mz_hs=b.doctor_mz_hs, " +
|
|
|
- " doctor_mz_hs_name=(select rtrim(name) from a_employee_mi where a_employee_mi.code = b.doctor_mz_hs), " +
|
|
|
- " ssbc=a.ssbc, " +
|
|
|
- " pd=(select max(e.admiss_times) " +
|
|
|
- " from zy_detail_charge e " +
|
|
|
- " where e.inpatient_no = a.inpatient_no " +
|
|
|
- " and e.admiss_times = a.admiss_times " +
|
|
|
- " and exec_unit = '1300000' " +
|
|
|
- " and e.charge_date >= a.op_datetime " +
|
|
|
- " group by e.inpatient_no, e.admiss_times), " +
|
|
|
- " doctor_zd_sj=b.doctor_zd_sj " +
|
|
|
- "FROM op_record a, " +
|
|
|
- " op_record_join b, " +
|
|
|
- " a_patient_mi c " +
|
|
|
- "where a.record_id = b.record_id " +
|
|
|
- " and a.inpatient_no = c.inpatient_no and " +
|
|
|
- " ${ew.sqlSegment} " +
|
|
|
- " order by a.urgent_clinic_flag desc ")
|
|
|
+ @Select("select a.record_id,op_start_date,op_end_date,anst_start_date,anst_end_date,a.sstc,a.req_date, " +
|
|
|
+ "a.zy_serial_no,a.op_times,a.patient_name,a.dept_code,a.ward_code,a.apply_date,a.apply_user,a.apply_doc, " +
|
|
|
+ "a.schedule_date,a.schedule_user,a.status,a.patient_type,a.act_order_no,a.op_code,a.op_name,a.op_datetime, " +
|
|
|
+ "a.room_code,room_name=(select rtrim(d.name) from op_zd_room d where d.code=a.room_code),a.op_group_code, " +
|
|
|
+ "a.hocus_code,hocus_name=(select rtrim(d.name) from zd_anaesthesia d where d.code=a.hocus_code), " +
|
|
|
+ "a.diag_before_op,a.diag_after_op,a.infection_flag,a.urgent_clinic_flag,a.avocation_flag,a.blood_amount, " +
|
|
|
+ "a.blood_type,a.op_stastics_id,a.isolation_indicator,a.op_scale,a.op_endtime,a.diag_before_code, " +
|
|
|
+ "a.diag_after_code,a.hbsag,a.body_code,a.part_code,a.specialreq_code,a.instrument_code,a.aspesis_scale, " +
|
|
|
+ "a.remark,a.op_dept,a.input_id,a.input_date,a.req_id,a.req_date,a.last_modify_id,a.arrange_id, " +
|
|
|
+ "a.arrange_date,a.inpatient_no,a.admiss_times,a.cancel_id,a.cancel_time,b.doctor_zd,b.doctor_mz, " +
|
|
|
+ "b.doctor_1,b.doctor_2,b.nurse_xh,b.nurse_qx,a.bed_no," +
|
|
|
+ "chargeSum=(select sum(d.charge_amount) from zy_detail_charge d where " +
|
|
|
+ "d.inpatient_no=a.inpatient_no and d.ss_code=a.record_id), " +
|
|
|
+ "sex=case when c.sex='1' then '男' else '女' end, " +
|
|
|
+ "age=case when c.birth_date is null then '' " +
|
|
|
+ "when datediff(year, c.birth_date, a.op_datetime) > 14 then " +
|
|
|
+ "convert(varchar(2), datediff(year, c.birth_date, a.op_datetime)) + '岁' " +
|
|
|
+ "when datediff(dd, c.birth_date, a.op_datetime) >= 365 then " +
|
|
|
+ "convert(varchar(2), datediff(dd, c.birth_date, a.op_datetime) / 365) + '岁' + " +
|
|
|
+ "convert(varchar(2), ((datediff(dd, c.birth_date, a.op_datetime) / 30) % 12)) + '月' " +
|
|
|
+ "when datediff(dd, c.birth_date, a.op_datetime) < 30 then " +
|
|
|
+ "convert(varchar(2), case datediff(dd, c.birth_date, a.op_datetime) " +
|
|
|
+ "when 0 then 1 else datediff(dd, c.birth_date, a.op_datetime) end) + '天' " +
|
|
|
+ "else convert(varchar(2), datediff(dd, c.birth_date, a.op_datetime) / 30) + '月' end, " +
|
|
|
+ "a.tw_flag,b.doctor_mz_ys,b.doctor_mz_hs,rtrim(a.ssbc) as ssbc,b.doctor_zd_sj " +
|
|
|
+ "FROM op_record a,op_record_join b,a_patient_mi c " +
|
|
|
+ "where a.record_id=b.record_id and a.inpatient_no=c.inpatient_no and " +
|
|
|
+ " ${ew.sqlSegment} order by a.urgent_clinic_flag desc")
|
|
|
List<OpRecord> huoQuShouShuAnPaiXinXi(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
|
|
|
|
|
|
+ @Select("select code,name,status_flag from op_zd_room")
|
|
|
+ List<CodeName> selectSurgeryRooms();
|
|
|
|
|
|
- @Update("update op_record " +
|
|
|
- "set op_start_date = #{opStartDate}, " +
|
|
|
- " op_end_date = #{opEndDate}, " +
|
|
|
- " anst_start_date = #{anstStartDate}, " +
|
|
|
- " anst_end_date = #{anstEndDate} " +
|
|
|
- "where record_id = #{recordId} " +
|
|
|
- " and inpatient_no = #{inpatientNo}")
|
|
|
+ @Update("update op_record set op_start_date=#{opStartDate},op_end_date=#{opEndDate}, " +
|
|
|
+ "anst_start_date=#{anstStartDate},anst_end_date=#{anstEndDate} " +
|
|
|
+ "where record_id=#{recordId} and inpatient_no=#{inpatientNo}")
|
|
|
void modifySurgeryTime(OpRecord pojo);
|
|
|
+
|
|
|
+ @Update("update op_record set status='d' where record_id=#{recordId}")
|
|
|
+ void cancelSurgery(Integer recordId);
|
|
|
+
|
|
|
+ @Update("update ${table} set ${column}=#{value} where record_id=#{id}")
|
|
|
+ void updateArrangement(String table, String column, String value, Integer id);
|
|
|
}
|