<p>====== 后台批量修改电子病历权限 ======</p><p><br/></p><p>&nbsp;===== 批量添加某工号,加上所有科室&nbsp; =====<br/></p><p><br/></p><pre class="brush:sql;toolbar:false"> delete&nbsp;USERDEPT&nbsp;where&nbsp;USERID=&#39;694&#39; insert&nbsp;into&nbsp;USERDEPT&nbsp;select&nbsp;distinct&nbsp;&nbsp;&#39;694&#39;,t.deptadmissionto,0,0,600012,0,0,null,null&nbsp;FROM&nbsp;patvisit&nbsp;t&nbsp;&nbsp;where&nbsp;t.dischargedatetime&nbsp;is&nbsp;null&nbsp;and&nbsp;&nbsp;deptadmissionto&nbsp;is&nbsp;not&nbsp;null</pre><p><br/></p><p>===== 批量把某工号的权限赋值给其他工号&nbsp; =====</p><p><br/></p><p>示例里,把黄振宇(694)权限,全部复制给陈巧儿(288)</p><p>delete JHAUTHUSERVSROLE where userid=&#39;288&#39;;</p><p><br/></p><p>insert into JHAUTHUSERVSROLE(USERID, ROLEID,SYNCHROFLAG, DEFAULTROLEFLAG, HOSPITALNO) select 288, ROLEID,SYNCHROFLAG, DEFAULTROLEFLAG, HOSPITALNO from JHAUTHUSERVSROLE where userid=&#39;694&#39;</p><p><br/></p>