Redeem 2 năm trước cách đây
mục cha
commit
37243ba34e

+ 3 - 0
src/main/java/com/steerinfo/dil/controller/BackgroundProcessingController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 import com.steerinfo.dil.util.SSOUtil;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -53,7 +54,9 @@ public class BackgroundProcessingController extends BaseRESTfulController {
             Map<String, Object> userInfo = (Map<String, Object>) dataMap.get("user");
             // 根据用户名去查询该用户绑定的公司及下属公司
             List<Map<String, Object>> companyList = backgroundProcessingMapper.getCompanyList(loginName);
+            List<Map<String,Object>> currentCompanyList = backgroundProcessingMapper.getCurrentCompanyList(loginName);
             userInfo.put("dilCompanyList", companyList);
+            userInfo.put("currentCompanyList",currentCompanyList);
             // 根据查询到的公司ID
             //System.out.println(userInfo);
             //// 获取机构

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/BackgroundProcessingMapper.java

@@ -88,4 +88,6 @@ public interface BackgroundProcessingMapper {
 
     List<Map<String,Object>> getCompanyList(String userName);
 
+    List<Map<String, Object>> getCurrentCompanyList(String loginName);
+
 }

+ 14 - 0
src/main/resources/com/steerinfo/dil/mapper/BackgroundProcessingMapper.xml

@@ -32,5 +32,19 @@
         RP.PERSONNEL_JOB_NUMBER = #{userName}
         ) connect BY PRIOR RC.COMPANY_ID = rc.PARENT_COMPANY_ID
     </select>
+    <select id="getCurrentCompanyList" resultType="java.util.Map">
+        SELECT distinct rc.company_id "companyId",
+                        rc.COMPANY_TYPE "companyType",
+                        rc.DELETED "deleted"
+        FROM RMS_PERSONNEL RP
+        LEFT JOIN RMS_PERSONNEL_COMPANY RPC
+        on RP.PERSONNEL_ID = RPC.PERSONNEL_ID
+        LEFT JOIN RMS_COMPANY RC
+        ON RC.COMPANY_ID = RPC.COMPANY_ID
+        WHERE
+        RPC.DELETED = 0
+        AND
+        RP.PERSONNEL_JOB_NUMBER = #{userName}
+    </select>
 
 </mapper>