12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package thyyxxk.webserver.dao.his.surgicalmanagement;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.toolkit.Constants;
- 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.dictionary.CodeName;
- import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord;
- import java.util.List;
- @Mapper
- public interface SurgeryArrangementDao {
- @Select("select rtrim(ward_code) as code, rtrim(ward_name) as name from zy_adtward")
- List<CodeName> getAllSurgicalWard();
- @Select("select code,name,status_flag from op_zd_room")
- List<CodeName> selectSurgeryRooms();
- @Select("select rtrim(code) as code,rtrim(name) as name from a_employee_mi " +
- "where dept_code='1300000' and isnull(del_flag,0)!=1")
- List<CodeName> selectSurgeryRoomStaffs();
- @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,a.arrangement_executed, " +
- "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, a.room_code")
- List<OpRecord> selectSurgeryArrangements(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
- @Update("update op_record set status=#{status} where record_id=#{recordId}")
- void updateSurgeryStatus(Integer recordId, String status);
- @Update("update ${table} set ${column}=#{value} where record_id=#{id}")
- void updateArrangement(String table, String column, String value, Integer id);
- @Select("select count(1) from dj_user_role where user_code=#{code} and role_id=51")
- Integer selectArrangementPermission(String code);
- }
|