stringsql="select c.CACHE_REMARK,c.PC_CODE,c.PC_FILE_NAME,c.PC_FILE_URL,c.id as cid,c.USERS_UID,c.EMP_NAME,c.IDNUMBER,(select o.org_name from fire_org o where o.org_id = c.org_id) org_name,(select o.org_name from fire_org o where o.org_id = c.new_org_id) new_org_name,m.id as mid,m.APPROVAL_RANK,m.SENDERTIME,c.Cache_Type from tbl_sys_emp_move m left join tbl_sys_emp_cache c on m.INSTANCEID = c.ID where ";
empSql.sql="insert into tbl_sys_emp (ID,USERS_UID,EMP_NAME,EMP_NUM,EMP_SEX,ORG_ID,DEPT_ID,EMP_EMAIL,EMP_MOBILE,IS_DEL,IDNUMBER,FIRE_PRO,CERT,NATION,FACE,MAR,IS_WORK,PROF,POL,PHOTO,IS_LEADER,ENLISTED_TIME,IS_ACCESS,DURING_ACCESS_PERIOD,ISDRIVER,FILENUM,PERMISSIONNUM,FIRSTCARD,EFFECTIVETIME,PERMITTEDORGAN,BIRTHDAY,FAMILYADDR,ALL_ANNUAL_LEAVE,AVAILABLE_ANNUAL_LEAVE,CID,POSTS,TAGS,IS_TRAIN,IS_ADMIN,IS_ADMIN_DB,TAGS_BAK,createtime,IS_VISITOR_CHECK,OPENID,DURING_ACCESS_PERIOD2,ACCESSALLOWEDMODE,IS_SUBCAMPVIDEO,ADMIN_LEVEL,BLOOD_TYPE) select ID,USERS_UID,EMP_NAME,EMP_NUM,EMP_SEX,ORG_ID,DEPT_ID,EMP_EMAIL,EMP_MOBILE,IS_DEL,IDNUMBER,FIRE_PRO,CERT,NATION,FACE,MAR,IS_WORK,PROF,POL,PHOTO,IS_LEADER,ENLISTED_TIME,IS_ACCESS,DURING_ACCESS_PERIOD,ISDRIVER,FILENUM,PERMISSIONNUM,FIRSTCARD,EFFECTIVETIME,PERMITTEDORGAN,BIRTHDAY,FAMILYADDR,ALL_ANNUAL_LEAVE,AVAILABLE_ANNUAL_LEAVE,CID,POSTS,TAGS,IS_TRAIN,IS_ADMIN,IS_ADMIN_DB,TAGS_BAK,createtime,IS_VISITOR_CHECK,OPENID,DURING_ACCESS_PERIOD2,ACCESSALLOWEDMODE,IS_SUBCAMPVIDEO,ADMIN_LEVEL,BLOOD_TYPE from tbl_sys_emp_cache where id = '"+cid+"'";
userSql.sql="insert into tbl_sys_users(ID,USERS_UID,USERS_PWD,USERS_NAME,USERS_WEEK,USERS_TIME,USERS_STATE,USERS_EMAIL,USERS_MOBILE,ORG_ID,EMP_ID,IS_THIS,IS_SUPER) select '"+newId+"',USERS_UID,'"+UsersPwd+"',EMP_NAME,'1,2,3,4,5,6,0','00:00:00 - 23:59:59','0',EMP_EMAIL,EMP_MOBILE,ORG_ID,EMPID,'0','1,5' from tbl_sys_emp_cache where id = '"+cid+"'";
ht.Add(userSql);
break;
case"2":// 跨营区调整
empSql.sql="update tbl_sys_emp e set e.org_id = (select new_org_id from tbl_sys_emp_cache where id = '"+cid+"'),e.dept_id = (select new_dept_id from tbl_sys_emp_cache where id = '"+cid+"') where e.id = (select empid from tbl_sys_emp_cache where id = '"+cid+"')";
ht.Add(empSql);
userSql.sql="update tbl_sys_users u set u.org_id = (select new_org_id from tbl_sys_emp_cache where id = '"+cid+"') where u.users_uid = (select users_uid from tbl_sys_emp_cache where id = '"+cid+"')";
stringsql="select t.*,(select o.org_name from fire_org o where o.org_id = t.org_id) org_name,(select o.org_name from fire_org o where o.org_id = t.dept_id) dept_name,(select dic_text from tbl_sys_dicdetail where mod_code = 'POLTYPE' and dic_value = t.POL) POL_NAME,(select dic_text from tbl_sys_dicdetail where mod_code = 'CERTTYPE' and dic_value = t.CERT) CERT_NAME,(select dic_text from tbl_sys_dicdetail where mod_code = 'NATIONTYPE' and dic_value = t.NATION) NATION_NAME, (select dic_text from tbl_sys_dicdetail where mod_code = 'FACETYPE' and dic_value = t.FACE) FACE_NAME,(select dic_text from tbl_sys_dicdetail where mod_code = 'MARTYPE' and dic_value = t.MAR) MAR_NAME, (select dic_text from tbl_sys_dicdetail where mod_code = 'IS_WORKTYPE' and dic_value = t.is_work) is_work_name,(select dic_text from tbl_sys_dicdetail where mod_code = 'PROFTYPE' and dic_value = t.prof) prof_name from tbl_sys_emp_cache t where id = '"+id+"'";