|  | @@ -107,116 +107,116 @@ public interface YiZhuLuRuDao {
 | 
	
		
			
				|  |  |                                  @Param("ledgerSn") Integer ledgerSn);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    @Select("select                     a.act_order_no,\n" +
 | 
	
		
			
				|  |  | -            "                           cast(cast(a.act_order_no as decimal) as varchar) id,\n" +
 | 
	
		
			
				|  |  | -            "    newOrderFlag         = (select count(*)\n" +
 | 
	
		
			
				|  |  | -            "                            from new_act_order_recording\n" +
 | 
	
		
			
				|  |  | -            "                            where new_act_order_recording.act_order_no = a.act_order_no),\n" +
 | 
	
		
			
				|  |  | -            "                           order_code,\n" +
 | 
	
		
			
				|  |  | -            "                           order_name,\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(frequ_code)                                frequ_code,\n" +
 | 
	
		
			
				|  |  | -            "    frequ_code_name      = (select rtrim(comm)\n" +
 | 
	
		
			
				|  |  | -            "                            from yz_order_frequency\n" +
 | 
	
		
			
				|  |  | -            "                            where code = frequ_code),\n" +
 | 
	
		
			
				|  |  | -            "                           instruction,\n" +
 | 
	
		
			
				|  |  | -            "                           discription,\n" +
 | 
	
		
			
				|  |  | -            "                           infant_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           order_time,\n" +
 | 
	
		
			
				|  |  | -            "                           physician,\n" +
 | 
	
		
			
				|  |  | -            "                           start_time,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_specification,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_quan,\n" +
 | 
	
		
			
				|  |  | -            "    mini_unit_name       = (select name\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_unit with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = mini_unit),\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(supply_code)                               supply_code,\n" +
 | 
	
		
			
				|  |  | -            "    supply_code_name     = (select rtrim(supply_name)\n" +
 | 
	
		
			
				|  |  | -            "                            from yz_supply_type with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where yz_supply_type.supply_code = a.supply_code),\n" +
 | 
	
		
			
				|  |  | -            "                           a.inpatient_no,\n" +
 | 
	
		
			
				|  |  | -            "                           a.admiss_times,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           enter_oper,\n" +
 | 
	
		
			
				|  |  | -            "    enter_oper_name      = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = enter_oper) /* 录入人 */,\n" +
 | 
	
		
			
				|  |  | -            "                           enter_time,\n" +
 | 
	
		
			
				|  |  | -            "                           mini_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_weight,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_weight_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(status_flag)                               status_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           status_time,\n" +
 | 
	
		
			
				|  |  | -            "                           parent_no,\n" +
 | 
	
		
			
				|  |  | -            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no),\n" +
 | 
	
		
			
				|  |  | -            "                           self_buy,\n" +
 | 
	
		
			
				|  |  | -            "                           dose,\n" +
 | 
	
		
			
				|  |  | -            "                           dose_unit,\n" +
 | 
	
		
			
				|  |  | -            "    dose_unit_name       = (select name\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_unit with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where dose_unit = code),\n" +
 | 
	
		
			
				|  |  | -            "                           drug_occ,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_volume,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_vol_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           exclu_back_time,\n" +
 | 
	
		
			
				|  |  | -            "                           exclu_act_order_no,\n" +
 | 
	
		
			
				|  |  | -            "                           pay_self,\n" +
 | 
	
		
			
				|  |  | -            "                           serial,\n" +
 | 
	
		
			
				|  |  | -            "                           group_no,\n" +
 | 
	
		
			
				|  |  | -            "                           signer,\n" +
 | 
	
		
			
				|  |  | -            "                           cl_code,\n" +
 | 
	
		
			
				|  |  | -            "                           doctor_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           emergency_flag,\n" +
 | 
	
		
			
				|  |  | -            "    exclu_type='',\n" +
 | 
	
		
			
				|  |  | -            "    end_time_b=end_time,\n" +
 | 
	
		
			
				|  |  | -            "    new_flag='0',\n" +
 | 
	
		
			
				|  |  | -            "    order_no_pattern=0,\n" +
 | 
	
		
			
				|  |  | -            "    suprice_flag='',\n" +
 | 
	
		
			
				|  |  | -            "    self_flag            ='',\n" +
 | 
	
		
			
				|  |  | -            "    pack_size=0.0,\n" +
 | 
	
		
			
				|  |  | -            "    parent_no_c=           -1000,\n" +
 | 
	
		
			
				|  |  | -            "                           reg_flag,\n" +
 | 
	
		
			
				|  |  | -            "    parent_flag='',\n" +
 | 
	
		
			
				|  |  | -            "                           yb_self_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           kf_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           refer_physician,\n" +
 | 
	
		
			
				|  |  | -            "                           consult_physician,\n" +
 | 
	
		
			
				|  |  | -            "    physician_name       = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = physician) /* 开这个医嘱的医生 */, \\\n" +
 | 
	
		
			
				|  |  | -            "                           exec_unit,\n" +
 | 
	
		
			
				|  |  | -            "    exec_unit_name       = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = exec_unit),\n" +
 | 
	
		
			
				|  |  | -            "                           a.dept_code,\n" +
 | 
	
		
			
				|  |  | -            "    dept_name            = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = dept_code),\n" +
 | 
	
		
			
				|  |  | -            "                           a.ward_code,\n" +
 | 
	
		
			
				|  |  | -            "    ward_name            = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = a.ward_code),\n" +
 | 
	
		
			
				|  |  | -            "    /*管床医生*/\n" +
 | 
	
		
			
				|  |  | -            "    refer_physician_name = (select rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = refer_physician),\n" +
 | 
	
		
			
				|  |  | -            "    group_no_name        = (select rtrim(group_name)\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_group_name with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where a.group_no = group_no),\n" +
 | 
	
		
			
				|  |  | -            "    signer_name          = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = signer) /*确认人*/,\n" +
 | 
	
		
			
				|  |  | -            "                           confirm_time /*确认时间*/,\n" +
 | 
	
		
			
				|  |  | -            "                           modifier,\n" +
 | 
	
		
			
				|  |  | -            "    modifier_name        = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = modifier) /*停止人*/,\n" +
 | 
	
		
			
				|  |  | -            "                           end_time /*停止时间*/,\n" +
 | 
	
		
			
				|  |  | -            "                           b.new_ward as                                    zkWardCode,\n" +
 | 
	
		
			
				|  |  | -            "                           b.new_dept as                                    zkDeptCode,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.yyfs,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.ssqk,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.yysj,\n" +
 | 
	
		
			
				|  |  | -            "    executer1            = (select name from a_employee_mi where code = executer1),\n" +
 | 
	
		
			
				|  |  | +    @Select("select                     a.act_order_no, " +
 | 
	
		
			
				|  |  | +            "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
 | 
	
		
			
				|  |  | +            "    newOrderFlag         = (select count(*) " +
 | 
	
		
			
				|  |  | +            "                            from new_act_order_recording " +
 | 
	
		
			
				|  |  | +            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
 | 
	
		
			
				|  |  | +            "                           order_code, " +
 | 
	
		
			
				|  |  | +            "                           order_name, " +
 | 
	
		
			
				|  |  | +            "                           rtrim(frequ_code)                                frequ_code, " +
 | 
	
		
			
				|  |  | +            "    frequ_code_name      = (select rtrim(comm) " +
 | 
	
		
			
				|  |  | +            "                            from yz_order_frequency " +
 | 
	
		
			
				|  |  | +            "                            where code = frequ_code), " +
 | 
	
		
			
				|  |  | +            "                           instruction, " +
 | 
	
		
			
				|  |  | +            "                           discription, " +
 | 
	
		
			
				|  |  | +            "                           infant_flag, " +
 | 
	
		
			
				|  |  | +            "                           order_time, " +
 | 
	
		
			
				|  |  | +            "                           physician, " +
 | 
	
		
			
				|  |  | +            "                           start_time, " +
 | 
	
		
			
				|  |  | +            "                           drug_specification, " +
 | 
	
		
			
				|  |  | +            "                           drug_quan, " +
 | 
	
		
			
				|  |  | +            "    mini_unit_name       = (select name " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_unit with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = mini_unit), " +
 | 
	
		
			
				|  |  | +            "                           rtrim(supply_code)                               supply_code, " +
 | 
	
		
			
				|  |  | +            "    supply_code_name     = (select rtrim(supply_name) " +
 | 
	
		
			
				|  |  | +            "                            from yz_supply_type with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where yz_supply_type.supply_code = a.supply_code), " +
 | 
	
		
			
				|  |  | +            "                           a.inpatient_no, " +
 | 
	
		
			
				|  |  | +            "                           a.admiss_times, " +
 | 
	
		
			
				|  |  | +            "                           drug_flag, " +
 | 
	
		
			
				|  |  | +            "                           enter_oper, " +
 | 
	
		
			
				|  |  | +            "    enter_oper_name      = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = enter_oper) /* 录入人 */, " +
 | 
	
		
			
				|  |  | +            "                           enter_time, " +
 | 
	
		
			
				|  |  | +            "                           mini_unit, " +
 | 
	
		
			
				|  |  | +            "                           drug_weight, " +
 | 
	
		
			
				|  |  | +            "                           drug_weight_unit, " +
 | 
	
		
			
				|  |  | +            "                           rtrim(status_flag)                               status_flag, " +
 | 
	
		
			
				|  |  | +            "                           status_time, " +
 | 
	
		
			
				|  |  | +            "                           parent_no, " +
 | 
	
		
			
				|  |  | +            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no), " +
 | 
	
		
			
				|  |  | +            "                           self_buy, " +
 | 
	
		
			
				|  |  | +            "                           dose, " +
 | 
	
		
			
				|  |  | +            "                           dose_unit, " +
 | 
	
		
			
				|  |  | +            "    dose_unit_name       = (select name " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_unit with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where dose_unit = code), " +
 | 
	
		
			
				|  |  | +            "                           drug_occ, " +
 | 
	
		
			
				|  |  | +            "                           drug_volume, " +
 | 
	
		
			
				|  |  | +            "                           drug_vol_unit, " +
 | 
	
		
			
				|  |  | +            "                           exclu_back_time, " +
 | 
	
		
			
				|  |  | +            "                           exclu_act_order_no, " +
 | 
	
		
			
				|  |  | +            "                           pay_self, " +
 | 
	
		
			
				|  |  | +            "                           serial, " +
 | 
	
		
			
				|  |  | +            "                           group_no, " +
 | 
	
		
			
				|  |  | +            "                           signer, " +
 | 
	
		
			
				|  |  | +            "                           cl_code, " +
 | 
	
		
			
				|  |  | +            "                           doctor_flag, " +
 | 
	
		
			
				|  |  | +            "                           emergency_flag, " +
 | 
	
		
			
				|  |  | +            "    exclu_type='', " +
 | 
	
		
			
				|  |  | +            "    end_time_b=end_time, " +
 | 
	
		
			
				|  |  | +            "    new_flag='0', " +
 | 
	
		
			
				|  |  | +            "    order_no_pattern=0, " +
 | 
	
		
			
				|  |  | +            "    suprice_flag='', " +
 | 
	
		
			
				|  |  | +            "    self_flag            ='', " +
 | 
	
		
			
				|  |  | +            "    pack_size=0.0, " +
 | 
	
		
			
				|  |  | +            "    parent_no_c=           -1000, " +
 | 
	
		
			
				|  |  | +            "                           reg_flag, " +
 | 
	
		
			
				|  |  | +            "    parent_flag='', " +
 | 
	
		
			
				|  |  | +            "                           yb_self_flag, " +
 | 
	
		
			
				|  |  | +            "                           kf_flag, " +
 | 
	
		
			
				|  |  | +            "                           refer_physician, " +
 | 
	
		
			
				|  |  | +            "                           consult_physician, " +
 | 
	
		
			
				|  |  | +            "    physician_name       = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = physician) /* 开这个医嘱的医生 */,  " +
 | 
	
		
			
				|  |  | +            "                           exec_unit, " +
 | 
	
		
			
				|  |  | +            "    exec_unit_name       = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = exec_unit), " +
 | 
	
		
			
				|  |  | +            "                           a.dept_code, " +
 | 
	
		
			
				|  |  | +            "    dept_name            = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = dept_code), " +
 | 
	
		
			
				|  |  | +            "                           a.ward_code, " +
 | 
	
		
			
				|  |  | +            "    ward_name            = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = a.ward_code), " +
 | 
	
		
			
				|  |  | +            "    /*管床医生*/ " +
 | 
	
		
			
				|  |  | +            "    refer_physician_name = (select rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = refer_physician), " +
 | 
	
		
			
				|  |  | +            "    group_no_name        = (select rtrim(group_name) " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_group_name with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where a.group_no = group_no), " +
 | 
	
		
			
				|  |  | +            "    signer_name          = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = signer) /*确认人*/, " +
 | 
	
		
			
				|  |  | +            "                           confirm_time /*确认时间*/, " +
 | 
	
		
			
				|  |  | +            "                           modifier, " +
 | 
	
		
			
				|  |  | +            "    modifier_name        = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = modifier) /*停止人*/, " +
 | 
	
		
			
				|  |  | +            "                           end_time /*停止时间*/, " +
 | 
	
		
			
				|  |  | +            "                           b.new_ward as                                    zkWardCode, " +
 | 
	
		
			
				|  |  | +            "                           b.new_dept as                                    zkDeptCode, " +
 | 
	
		
			
				|  |  | +            "                           kss.yyfs, " +
 | 
	
		
			
				|  |  | +            "                           kss.ssqk, " +
 | 
	
		
			
				|  |  | +            "                           kss.yysj, " +
 | 
	
		
			
				|  |  | +            "    executer1            = (select name from a_employee_mi where code = executer1), " +
 | 
	
		
			
				|  |  |              "    executer2=             (select name from a_employee_mi where code = executer2) " +
 | 
	
		
			
				|  |  |              "from yz_act_order a  with (NOLOCK) left join " +
 | 
	
		
			
				|  |  |              "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
 | 
	
	
		
			
				|  | @@ -225,116 +225,116 @@ public interface YiZhuLuRuDao {
 | 
	
		
			
				|  |  |      List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    @Select("select                     a.act_order_no,\n" +
 | 
	
		
			
				|  |  | -            "                           cast(cast(a.act_order_no as decimal) as varchar) id,\n" +
 | 
	
		
			
				|  |  | -            "    newOrderFlag         = (select count(*)\n" +
 | 
	
		
			
				|  |  | -            "                            from new_act_order_recording\n" +
 | 
	
		
			
				|  |  | -            "                            where new_act_order_recording.act_order_no = a.act_order_no),\n" +
 | 
	
		
			
				|  |  | -            "                           order_code,\n" +
 | 
	
		
			
				|  |  | -            "                           order_name,\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(frequ_code)                                frequ_code,\n" +
 | 
	
		
			
				|  |  | -            "    frequ_code_name      = (select rtrim(comm)\n" +
 | 
	
		
			
				|  |  | -            "                            from yz_order_frequency\n" +
 | 
	
		
			
				|  |  | -            "                            where code = frequ_code),\n" +
 | 
	
		
			
				|  |  | -            "                           instruction,\n" +
 | 
	
		
			
				|  |  | -            "                           discription,\n" +
 | 
	
		
			
				|  |  | -            "                           infant_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           order_time,\n" +
 | 
	
		
			
				|  |  | -            "                           physician,\n" +
 | 
	
		
			
				|  |  | -            "                           start_time,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_specification,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_quan,\n" +
 | 
	
		
			
				|  |  | -            "    mini_unit_name      = (select name\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_unit with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = mini_unit),\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(supply_code)                               supply_code,\n" +
 | 
	
		
			
				|  |  | -            "    supply_code_name     = (select rtrim(supply_name)\n" +
 | 
	
		
			
				|  |  | -            "                            from yz_supply_type with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where yz_supply_type.supply_code = a.supply_code),\n" +
 | 
	
		
			
				|  |  | -            "                           a.inpatient_no,\n" +
 | 
	
		
			
				|  |  | -            "                           a.admiss_times,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           enter_oper,\n" +
 | 
	
		
			
				|  |  | -            "    enter_oper_name      = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = enter_oper) /* 录入人 */,\n" +
 | 
	
		
			
				|  |  | -            "                           enter_time,\n" +
 | 
	
		
			
				|  |  | -            "                           mini_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_weight,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_weight_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           rtrim(status_flag)                               status_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           status_time,\n" +
 | 
	
		
			
				|  |  | -            "                           parent_no,\n" +
 | 
	
		
			
				|  |  | -            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no),\n" +
 | 
	
		
			
				|  |  | -            "                           self_buy,\n" +
 | 
	
		
			
				|  |  | -            "                           dose,\n" +
 | 
	
		
			
				|  |  | -            "                           dose_unit,\n" +
 | 
	
		
			
				|  |  | -            "    dose_unit_name       = (select name\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_unit with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where dose_unit = code),\n" +
 | 
	
		
			
				|  |  | -            "                           drug_occ,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_volume,\n" +
 | 
	
		
			
				|  |  | -            "                           drug_vol_unit,\n" +
 | 
	
		
			
				|  |  | -            "                           exclu_back_time,\n" +
 | 
	
		
			
				|  |  | -            "                           exclu_act_order_no,\n" +
 | 
	
		
			
				|  |  | -            "                           pay_self,\n" +
 | 
	
		
			
				|  |  | -            "                           serial,\n" +
 | 
	
		
			
				|  |  | -            "                           group_no,\n" +
 | 
	
		
			
				|  |  | -            "                           signer,\n" +
 | 
	
		
			
				|  |  | -            "                           cl_code,\n" +
 | 
	
		
			
				|  |  | -            "                           doctor_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           emergency_flag,\n" +
 | 
	
		
			
				|  |  | -            "    exclu_type='',\n" +
 | 
	
		
			
				|  |  | -            "    end_time_b=end_time,\n" +
 | 
	
		
			
				|  |  | -            "    new_flag='0',\n" +
 | 
	
		
			
				|  |  | -            "    order_no_pattern=0,\n" +
 | 
	
		
			
				|  |  | -            "    suprice_flag='',\n" +
 | 
	
		
			
				|  |  | -            "    self_flag            ='',\n" +
 | 
	
		
			
				|  |  | -            "    pack_size=0.0,\n" +
 | 
	
		
			
				|  |  | -            "    parent_no_c=           -1000,\n" +
 | 
	
		
			
				|  |  | -            "                           reg_flag,\n" +
 | 
	
		
			
				|  |  | -            "    parent_flag='',\n" +
 | 
	
		
			
				|  |  | -            "                           yb_self_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           kf_flag,\n" +
 | 
	
		
			
				|  |  | -            "                           refer_physician,\n" +
 | 
	
		
			
				|  |  | -            "                           consult_physician,\n" +
 | 
	
		
			
				|  |  | -            "    physician_name       = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | +    @Select("select                     a.act_order_no, " +
 | 
	
		
			
				|  |  | +            "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
 | 
	
		
			
				|  |  | +            "    newOrderFlag         = (select count(*) " +
 | 
	
		
			
				|  |  | +            "                            from new_act_order_recording " +
 | 
	
		
			
				|  |  | +            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
 | 
	
		
			
				|  |  | +            "                           order_code, " +
 | 
	
		
			
				|  |  | +            "                           order_name, " +
 | 
	
		
			
				|  |  | +            "                           rtrim(frequ_code)                                frequ_code, " +
 | 
	
		
			
				|  |  | +            "    frequ_code_name      = (select rtrim(comm) " +
 | 
	
		
			
				|  |  | +            "                            from yz_order_frequency " +
 | 
	
		
			
				|  |  | +            "                            where code = frequ_code), " +
 | 
	
		
			
				|  |  | +            "                           instruction, " +
 | 
	
		
			
				|  |  | +            "                           discription, " +
 | 
	
		
			
				|  |  | +            "                           infant_flag, " +
 | 
	
		
			
				|  |  | +            "                           order_time, " +
 | 
	
		
			
				|  |  | +            "                           physician, " +
 | 
	
		
			
				|  |  | +            "                           start_time, " +
 | 
	
		
			
				|  |  | +            "                           drug_specification, " +
 | 
	
		
			
				|  |  | +            "                           drug_quan, " +
 | 
	
		
			
				|  |  | +            "    mini_unit_name      = (select name " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_unit with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = mini_unit), " +
 | 
	
		
			
				|  |  | +            "                           rtrim(supply_code)                               supply_code, " +
 | 
	
		
			
				|  |  | +            "    supply_code_name     = (select rtrim(supply_name) " +
 | 
	
		
			
				|  |  | +            "                            from yz_supply_type with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where yz_supply_type.supply_code = a.supply_code), " +
 | 
	
		
			
				|  |  | +            "                           a.inpatient_no, " +
 | 
	
		
			
				|  |  | +            "                           a.admiss_times, " +
 | 
	
		
			
				|  |  | +            "                           drug_flag, " +
 | 
	
		
			
				|  |  | +            "                           enter_oper, " +
 | 
	
		
			
				|  |  | +            "    enter_oper_name      = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = enter_oper) /* 录入人 */, " +
 | 
	
		
			
				|  |  | +            "                           enter_time, " +
 | 
	
		
			
				|  |  | +            "                           mini_unit, " +
 | 
	
		
			
				|  |  | +            "                           drug_weight, " +
 | 
	
		
			
				|  |  | +            "                           drug_weight_unit, " +
 | 
	
		
			
				|  |  | +            "                           rtrim(status_flag)                               status_flag, " +
 | 
	
		
			
				|  |  | +            "                           status_time, " +
 | 
	
		
			
				|  |  | +            "                           parent_no, " +
 | 
	
		
			
				|  |  | +            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no), " +
 | 
	
		
			
				|  |  | +            "                           self_buy, " +
 | 
	
		
			
				|  |  | +            "                           dose, " +
 | 
	
		
			
				|  |  | +            "                           dose_unit, " +
 | 
	
		
			
				|  |  | +            "    dose_unit_name       = (select name " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_unit with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where dose_unit = code), " +
 | 
	
		
			
				|  |  | +            "                           drug_occ, " +
 | 
	
		
			
				|  |  | +            "                           drug_volume, " +
 | 
	
		
			
				|  |  | +            "                           drug_vol_unit, " +
 | 
	
		
			
				|  |  | +            "                           exclu_back_time, " +
 | 
	
		
			
				|  |  | +            "                           exclu_act_order_no, " +
 | 
	
		
			
				|  |  | +            "                           pay_self, " +
 | 
	
		
			
				|  |  | +            "                           serial, " +
 | 
	
		
			
				|  |  | +            "                           group_no, " +
 | 
	
		
			
				|  |  | +            "                           signer, " +
 | 
	
		
			
				|  |  | +            "                           cl_code, " +
 | 
	
		
			
				|  |  | +            "                           doctor_flag, " +
 | 
	
		
			
				|  |  | +            "                           emergency_flag, " +
 | 
	
		
			
				|  |  | +            "    exclu_type='', " +
 | 
	
		
			
				|  |  | +            "    end_time_b=end_time, " +
 | 
	
		
			
				|  |  | +            "    new_flag='0', " +
 | 
	
		
			
				|  |  | +            "    order_no_pattern=0, " +
 | 
	
		
			
				|  |  | +            "    suprice_flag='', " +
 | 
	
		
			
				|  |  | +            "    self_flag            ='', " +
 | 
	
		
			
				|  |  | +            "    pack_size=0.0, " +
 | 
	
		
			
				|  |  | +            "    parent_no_c=           -1000, " +
 | 
	
		
			
				|  |  | +            "                           reg_flag, " +
 | 
	
		
			
				|  |  | +            "    parent_flag='', " +
 | 
	
		
			
				|  |  | +            "                           yb_self_flag, " +
 | 
	
		
			
				|  |  | +            "                           kf_flag, " +
 | 
	
		
			
				|  |  | +            "                           refer_physician, " +
 | 
	
		
			
				|  |  | +            "                           consult_physician, " +
 | 
	
		
			
				|  |  | +            "    physician_name       = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  |              "                            where code = physician) /* 开这个医嘱的医生 */, \\\n" +
 | 
	
		
			
				|  |  | -            "                           exec_unit,\n" +
 | 
	
		
			
				|  |  | -            "    exec_unit_name       = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = exec_unit),\n" +
 | 
	
		
			
				|  |  | -            "                           a.dept_code,\n" +
 | 
	
		
			
				|  |  | -            "    dept_name            = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = dept_code),\n" +
 | 
	
		
			
				|  |  | -            "                           a.ward_code,\n" +
 | 
	
		
			
				|  |  | -            "    ward_name            = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from zd_unit_code with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = a.ward_code),\n" +
 | 
	
		
			
				|  |  | -            "    /*管床医生*/\n" +
 | 
	
		
			
				|  |  | -            "    refer_physician_name = (select rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = refer_physician),\n" +
 | 
	
		
			
				|  |  | -            "    group_no_name        = (select rtrim(group_name)\n" +
 | 
	
		
			
				|  |  | -            "                            from yp_zd_group_name with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where a.group_no = group_no),\n" +
 | 
	
		
			
				|  |  | -            "    signer_name          = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = signer) /*确认人*/,\n" +
 | 
	
		
			
				|  |  | -            "                           confirm_time /*确认时间*/,\n" +
 | 
	
		
			
				|  |  | -            "                           modifier,\n" +
 | 
	
		
			
				|  |  | -            "    modifier_name        = (select top (1) rtrim(name)\n" +
 | 
	
		
			
				|  |  | -            "                            from a_employee_mi with (NOLOCK)\n" +
 | 
	
		
			
				|  |  | -            "                            where code = modifier) /*停止人*/,\n" +
 | 
	
		
			
				|  |  | -            "                           end_time /*停止时间*/,\n" +
 | 
	
		
			
				|  |  | -            "                           b.new_ward as                                    zkWardCode,\n" +
 | 
	
		
			
				|  |  | -            "                           b.new_dept as                                    zkDeptCode,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.yyfs,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.ssqk,\n" +
 | 
	
		
			
				|  |  | -            "                           kss.yysj,\n" +
 | 
	
		
			
				|  |  | -            "    executer1            = (select name from a_employee_mi where code = executer1),\n" +
 | 
	
		
			
				|  |  | +            "                           exec_unit, " +
 | 
	
		
			
				|  |  | +            "    exec_unit_name       = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = exec_unit), " +
 | 
	
		
			
				|  |  | +            "                           a.dept_code, " +
 | 
	
		
			
				|  |  | +            "    dept_name            = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = dept_code), " +
 | 
	
		
			
				|  |  | +            "                           a.ward_code, " +
 | 
	
		
			
				|  |  | +            "    ward_name            = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from zd_unit_code with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = a.ward_code), " +
 | 
	
		
			
				|  |  | +            "    /*管床医生*/ " +
 | 
	
		
			
				|  |  | +            "    refer_physician_name = (select rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = refer_physician), " +
 | 
	
		
			
				|  |  | +            "    group_no_name        = (select rtrim(group_name) " +
 | 
	
		
			
				|  |  | +            "                            from yp_zd_group_name with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where a.group_no = group_no), " +
 | 
	
		
			
				|  |  | +            "    signer_name          = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = signer) /*确认人*/, " +
 | 
	
		
			
				|  |  | +            "                           confirm_time /*确认时间*/, " +
 | 
	
		
			
				|  |  | +            "                           modifier, " +
 | 
	
		
			
				|  |  | +            "    modifier_name        = (select top (1) rtrim(name) " +
 | 
	
		
			
				|  |  | +            "                            from a_employee_mi with (NOLOCK) " +
 | 
	
		
			
				|  |  | +            "                            where code = modifier) /*停止人*/, " +
 | 
	
		
			
				|  |  | +            "                           end_time /*停止时间*/, " +
 | 
	
		
			
				|  |  | +            "                           b.new_ward as                                    zkWardCode, " +
 | 
	
		
			
				|  |  | +            "                           b.new_dept as                                    zkDeptCode, " +
 | 
	
		
			
				|  |  | +            "                           kss.yyfs, " +
 | 
	
		
			
				|  |  | +            "                           kss.ssqk, " +
 | 
	
		
			
				|  |  | +            "                           kss.yysj, " +
 | 
	
		
			
				|  |  | +            "    executer1            = (select name from a_employee_mi where code = executer1), " +
 | 
	
		
			
				|  |  |              "    executer2=             (select name from a_employee_mi where code = executer2) " +
 | 
	
		
			
				|  |  |              "from yz_inact_order a  with (NOLOCK) left join " +
 | 
	
		
			
				|  |  |              "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
 |