Ver código fonte

'人员管理权限'

HUJIANGUO 3 anos atrás
pai
commit
24e0df90bd

+ 1 - 1
pom.xml

@@ -111,7 +111,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>RMS_CARRIER</param>
+                        <param>RMS_PERSONNEL</param>
                     </tables>
                 </configuration>
                 <executions>

+ 41 - 0
src/main/java/com/steerinfo/dil/controller/RmsPersonnelController.java

@@ -176,4 +176,45 @@ public class RmsPersonnelController extends BaseRESTfulController {
         return  success(rmsPersonnelService.getShipperId());
     }
 
+    /**
+     * 得到二级部门的下拉
+     * @return
+     */
+    @GetMapping("/getSecondShipper")
+    public RESTfulResult getSecondShipper() {
+        return  success(rmsPersonnelService.getSecondShipper());
+    }
+
+    /**
+     * 得到三级部门的下拉
+     * @return
+     */
+    @GetMapping("/getThirdShipper")
+    public RESTfulResult getThirdShipper(@RequestParam Integer shipperId) {
+        return  success(rmsPersonnelService.getThirdShipper(new BigDecimal(shipperId)));
+    }
+
+    /**
+     * 查询SSO主键和机构编码
+     * @return
+     */
+    @PostMapping("/getShipperMap")
+    public RESTfulResult getShipperMap(@RequestParam Integer shipperId) {
+        return  success(rmsPersonnelService.getShipperMap(new BigDecimal(shipperId)));
+    }
+
+    /**
+     * 新增人员权限
+     * @param rmsPersonnel
+     * @return
+     */
+    @ApiOperation(value="创建", notes="RmsPersonnel对象创建")
+    @PostMapping(value = "/addPersonnel")
+    public RESTfulResult addPersonnel(@RequestBody RmsPersonnel rmsPersonnel){
+        int result = rmsPersonnelService.addPersonnel(rmsPersonnel);
+        if (result <= 0){
+            return failed();
+        }
+        return success(result);
+    }
 }

+ 6 - 0
src/main/java/com/steerinfo/dil/mapper/RmsPersonnelMapper.java

@@ -24,4 +24,10 @@ public interface RmsPersonnelMapper extends IBaseMapper<RmsPersonnel, BigDecimal
     List<Map<String, Object>> selectPersonnelById(BigDecimal id);
 //获得托运人id
     List<Map<String, Object>> getShipperId();
+// 获得二级部门信息
+    List<Map<String, Object>> getSecondShipper();
+// 得到三级部门信息
+    List<Map<String, Object>> getThirdShipper(BigDecimal shipperId);
+// 查询sso主键和机构编码
+    Map<String, Object> getShipperMap(BigDecimal shipperId);
 }

+ 36 - 23
src/main/java/com/steerinfo/dil/model/RmsPersonnel.java

@@ -10,15 +10,15 @@ import java.util.Date;
 @ApiModel(value="人员管理")
 public class RmsPersonnel implements IBasePO<BigDecimal> {
     /**
-     * 主键ID(PERSONNEL_ID,DECIMAL,38)
+     * 主键ID(PERSONNEL_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="主键ID",required=true)
     private BigDecimal personnelId;
 
     /**
-     * 号(PERSONNEL_JOB_NUMBER,VARCHAR,20)
+     * 号(PERSONNEL_JOB_NUMBER,VARCHAR,20)
      */
-    @ApiModelProperty(value="号",required=false)
+    @ApiModelProperty(value="号",required=false)
     private String personnelJobNumber;
 
     /**
@@ -34,16 +34,16 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
     private String personnelName;
 
     /**
-     * 部门ID(关联托运人)(SHIPPER_ID,DECIMAL,38)
+     * 部门ID(关联托运人)(PERSONNEL_DEPARTMENT_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="部门ID(关联托运人)",required=false)
-    private BigDecimal departmentId;
+    private BigDecimal personnelDepartmentId;
 
     /**
-     * 车间(PERSONNEL_WORKSHOPID,VARCHAR,20)
+     * 车间(PERSONNEL_WORKSHOPID,DECIMAL,0)
      */
     @ApiModelProperty(value="车间",required=false)
-    private String personnelWorkshopid;
+    private BigDecimal personnelWorkshopid;
 
     /**
      * 班次(早、中、夜)(PERSONNEL_SHIFTS,VARCHAR,20)
@@ -88,10 +88,10 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
     private String insertUpdateRemark;
 
     /**
-     * 金蝶人员信息主键ID(EAS_PERSONNEL_ID,DECIMAL,0)
+     * 金蝶人员信息主键ID(EAS_PERSONNEL_ID,VARCHAR,50)
      */
     @ApiModelProperty(value="金蝶人员信息主键ID",required=false)
-    private BigDecimal easPersonnelId;
+    private String easPersonnelId;
 
     /**
      * 逻辑删除(DELETED,DECIMAL,0)
@@ -111,13 +111,11 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="密码(适用于登录)",required=false)
     private String password;
 
-    public BigDecimal getDepartmentId() {
-        return departmentId;
-    }
-
-    public void setDepartmentId(BigDecimal departmentId) {
-        this.departmentId = departmentId;
-    }
+    /**
+     * SSO主键(PERSONNEL_SSO_ID,VARCHAR,100)
+     */
+    @ApiModelProperty(value="SSO主键",required=false)
+    private String personnelSsoId;
 
     private static final long serialVersionUID = 1L;
 
@@ -163,14 +161,20 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         this.personnelName = personnelName == null ? null : personnelName.trim();
     }
 
+    public BigDecimal getPersonnelDepartmentId() {
+        return personnelDepartmentId;
+    }
 
+    public void setPersonnelDepartmentId(BigDecimal personnelDepartmentId) {
+        this.personnelDepartmentId = personnelDepartmentId;
+    }
 
-    public String getPersonnelWorkshopid() {
+    public BigDecimal getPersonnelWorkshopid() {
         return personnelWorkshopid;
     }
 
-    public void setPersonnelWorkshopid(String personnelWorkshopid) {
-        this.personnelWorkshopid = personnelWorkshopid == null ? null : personnelWorkshopid.trim();
+    public void setPersonnelWorkshopid(BigDecimal personnelWorkshopid) {
+        this.personnelWorkshopid = personnelWorkshopid;
     }
 
     public String getPersonnelShifts() {
@@ -229,12 +233,12 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
     }
 
-    public BigDecimal getEasPersonnelId() {
+    public String getEasPersonnelId() {
         return easPersonnelId;
     }
 
-    public void setEasPersonnelId(BigDecimal easPersonnelId) {
-        this.easPersonnelId = easPersonnelId;
+    public void setEasPersonnelId(String easPersonnelId) {
+        this.easPersonnelId = easPersonnelId == null ? null : easPersonnelId.trim();
     }
 
     public BigDecimal getDeleted() {
@@ -261,6 +265,14 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         this.password = password == null ? null : password.trim();
     }
 
+    public String getPersonnelSsoId() {
+        return personnelSsoId;
+    }
+
+    public void setPersonnelSsoId(String personnelSsoId) {
+        this.personnelSsoId = personnelSsoId == null ? null : personnelSsoId.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -271,7 +283,7 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         sb.append(", personnelJobNumber=").append(personnelJobNumber);
         sb.append(", personnelPost=").append(personnelPost);
         sb.append(", personnelName=").append(personnelName);
-        sb.append(", departmentId=").append(departmentId);
+        sb.append(", personnelDepartmentId=").append(personnelDepartmentId);
         sb.append(", personnelWorkshopid=").append(personnelWorkshopid);
         sb.append(", personnelShifts=").append(personnelShifts);
         sb.append(", personnelTeam=").append(personnelTeam);
@@ -284,6 +296,7 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         sb.append(", deleted=").append(deleted);
         sb.append(", username=").append(username);
         sb.append(", password=").append(password);
+        sb.append(", personnelSsoId=").append(personnelSsoId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 12 - 0
src/main/java/com/steerinfo/dil/service/IRmsPersonnelService.java

@@ -35,4 +35,16 @@ public interface IRmsPersonnelService {
     List<Map<String, Object>> getPersonnelById(BigDecimal id);
 //获得下拉托运人信息
     List<Map<String,Object>> getShipperId();
+
+    // 得到二级部门的下拉
+    List<Map<String,Object>> getSecondShipper();
+
+    // 得到三级部门的下拉
+    List<Map<String,Object>> getThirdShipper(BigDecimal shipperId);
+
+    // 新增人员权限
+    int addPersonnel(RmsPersonnel rmsPersonnel);
+
+    // 查询SSO主键和机构编码
+    Map<String,Object> getShipperMap(BigDecimal shipperId);
 }

+ 43 - 1
src/main/java/com/steerinfo/dil/service/impl/RmsPersonnelServiceImpl.java

@@ -52,7 +52,7 @@ public class RmsPersonnelServiceImpl implements IRmsPersonnelService {
         // 得到数据状态
         Integer dataStatus = (Integer) mapVal.get("dataStatus");
         RmsPersonnel rmsPersonnel = new RmsPersonnel();
-        rmsPersonnel.setEasPersonnelId(EASPersonnelId);
+//        rmsPersonnel.setEasPersonnelId(EASPersonnelId);
         rmsPersonnel.setPersonnelJobNumber(personnelJobNumber);
         rmsPersonnel.setPersonnelName(personnelName);
         BigDecimal deleted = new BigDecimal(0);
@@ -177,4 +177,46 @@ public class RmsPersonnelServiceImpl implements IRmsPersonnelService {
     public List<Map<String, Object>> getShipperId() {
         return rmsPersonnelMapper.getShipperId();
     }
+
+    /**
+     * 得到二级部门下拉
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getSecondShipper() {
+        return rmsPersonnelMapper.getSecondShipper();
+    }
+
+    /**
+     * 得到三级部门下拉
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getThirdShipper(BigDecimal shipperId) {
+        return rmsPersonnelMapper.getThirdShipper(shipperId);
+    }
+
+    /**
+     * 新增人员权限
+     * @param rmsPersonnel
+     * @return
+     */
+    @Override
+    public int addPersonnel(RmsPersonnel rmsPersonnel) {
+        BigDecimal personnelId = rmsPersonnelMapper.getPersonnelId();
+        rmsPersonnel.setPersonnelId(personnelId);
+        int result = rmsPersonnelMapper.insertSelective(rmsPersonnel);
+        return result;
+    }
+
+    /**
+     * 查询SSO主键和机构编码
+     * @param shipperId
+     * @return
+     */
+    @Override
+    public Map<String, Object> getShipperMap(BigDecimal shipperId) {
+        return rmsPersonnelMapper.getShipperMap(shipperId);
+    }
+
 }

+ 161 - 106
src/main/resources/com/steerinfo/dil/mapper/RmsPersonnelMapper.xml

@@ -6,8 +6,8 @@
     <result column="PERSONNEL_JOB_NUMBER" jdbcType="VARCHAR" property="personnelJobNumber" />
     <result column="PERSONNEL_POST" jdbcType="VARCHAR" property="personnelPost" />
     <result column="PERSONNEL_NAME" jdbcType="VARCHAR" property="personnelName" />
-    <result column="PERSONNEL_DEPARTMENT_ID" jdbcType="DECIMAL" property="departmentId" />
-    <result column="PERSONNEL_WORKSHOPID" jdbcType="VARCHAR" property="personnelWorkshopid" />
+    <result column="PERSONNEL_DEPARTMENT_ID" jdbcType="DECIMAL" property="personnelDepartmentId" />
+    <result column="PERSONNEL_WORKSHOPID" jdbcType="DECIMAL" property="personnelWorkshopid" />
     <result column="PERSONNEL_SHIFTS" jdbcType="VARCHAR" property="personnelShifts" />
     <result column="PERSONNEL_TEAM" jdbcType="VARCHAR" property="personnelTeam" />
     <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
@@ -15,27 +15,29 @@
     <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
-    <result column="EAS_PERSONNEL_ID" jdbcType="DECIMAL" property="easPersonnelId" />
+    <result column="EAS_PERSONNEL_ID" jdbcType="VARCHAR" property="easPersonnelId" />
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
     <result column="USERNAME" jdbcType="VARCHAR" property="username" />
     <result column="PASSWORD" jdbcType="VARCHAR" property="password" />
+    <result column="PERSONNEL_SSO_ID" jdbcType="VARCHAR" property="personnelSsoId" />
   </resultMap>
   <sql id="columns">
-    PERSONNEL_ID, PERSONNEL_JOB_NUMBER, PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, PERSONNEL_WORKSHOPID,
-    PERSONNEL_SHIFTS, PERSONNEL_TEAM, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-    UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID, DELETED, USERNAME, PASSWORD
+    PERSONNEL_ID, PERSONNEL_JOB_NUMBER, PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, 
+    PERSONNEL_WORKSHOPID, PERSONNEL_SHIFTS, PERSONNEL_TEAM, INSERT_USERNAME, INSERT_TIME, 
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID, DELETED, USERNAME, 
+    PASSWORD, PERSONNEL_SSO_ID
   </sql>
   <sql id="columns_alias">
-    t.PERSONNEL_ID, t.PERSONNEL_JOB_NUMBER, t.PERSONNEL_POST, t.PERSONNEL_NAME, t.PERSONNEL_DEPARTMENT_ID,
+    t.PERSONNEL_ID, t.PERSONNEL_JOB_NUMBER, t.PERSONNEL_POST, t.PERSONNEL_NAME, t.PERSONNEL_DEPARTMENT_ID, 
     t.PERSONNEL_WORKSHOPID, t.PERSONNEL_SHIFTS, t.PERSONNEL_TEAM, t.INSERT_USERNAME, 
     t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.EAS_PERSONNEL_ID, 
-    t.DELETED, t.USERNAME, t.PASSWORD
+    t.DELETED, t.USERNAME, t.PASSWORD, t.PERSONNEL_SSO_ID
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM RMS_PERSONNEL
+    SELECT <include refid="columns" /> FROM RMS_PERSONNEL
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM RMS_PERSONNEL t
+    SELECT <include refid="columns_alias" /> FROM RMS_PERSONNEL t
   </sql>
   <sql id="where">
     <where> 
@@ -51,10 +53,10 @@
       <if test="personnelName != null and personnelName != ''">
         and PERSONNEL_NAME = #{personnelName}
       </if>
-      <if test="departmentId != null">
-        and PERSONNEL_DEPARTMENT_ID = #{departmentId}
+      <if test="personnelDepartmentId != null">
+        and PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId}
       </if>
-      <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
+      <if test="personnelWorkshopid != null">
         and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
       </if>
       <if test="personnelShifts != null and personnelShifts != ''">
@@ -78,7 +80,7 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
-      <if test="easPersonnelId != null">
+      <if test="easPersonnelId != null and easPersonnelId != ''">
         and EAS_PERSONNEL_ID = #{easPersonnelId}
       </if>
       <if test="deleted != null">
@@ -90,6 +92,9 @@
       <if test="password != null and password != ''">
         and PASSWORD = #{password}
       </if>
+      <if test="personnelSsoId != null and personnelSsoId != ''">
+        and PERSONNEL_SSO_ID = #{personnelSsoId}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -106,11 +111,11 @@
       <if test="personnelName != null and personnelName != ''">
         and PERSONNEL_NAME LIKE '%${personnelName}%'
       </if>
-      <if test="departmentId != null">
-        and PERSONNEL_DEPARTMENT_ID = #{departmentId}
+      <if test="personnelDepartmentId != null">
+        and PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId}
       </if>
-      <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
-        and PERSONNEL_WORKSHOPID LIKE '%${personnelWorkshopid}%'
+      <if test="personnelWorkshopid != null">
+        and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
       </if>
       <if test="personnelShifts != null and personnelShifts != ''">
         and PERSONNEL_SHIFTS LIKE '%${personnelShifts}%'
@@ -133,8 +138,8 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
       </if>
-      <if test="easPersonnelId != null">
-        and EAS_PERSONNEL_ID = #{easPersonnelId}
+      <if test="easPersonnelId != null and easPersonnelId != ''">
+        and EAS_PERSONNEL_ID LIKE '%${easPersonnelId}%'
       </if>
       <if test="deleted != null">
         and DELETED = #{deleted}
@@ -145,9 +150,12 @@
       <if test="password != null and password != ''">
         and PASSWORD LIKE '%${password}%'
       </if>
+      <if test="personnelSsoId != null and personnelSsoId != ''">
+        and PERSONNEL_SSO_ID LIKE '%${personnelSsoId}%'
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from RMS_PERSONNEL
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </delete>
@@ -163,10 +171,10 @@
       <if test="personnelName != null and personnelName != ''">
         or PERSONNEL_NAME = #{personnelName}
       </if>
-      <if test="departmentId != null">
-        or PERSONNEL_DEPARTMENT_ID = #{departmentId}
+      <if test="personnelDepartmentId != null">
+        or PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId}
       </if>
-      <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
+      <if test="personnelWorkshopid != null">
         or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
       </if>
       <if test="personnelShifts != null and personnelShifts != ''">
@@ -190,7 +198,7 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
-      <if test="easPersonnelId != null">
+      <if test="easPersonnelId != null and easPersonnelId != ''">
         or EAS_PERSONNEL_ID = #{easPersonnelId}
       </if>
       <if test="deleted != null">
@@ -202,22 +210,25 @@
       <if test="password != null and password != ''">
         or PASSWORD = #{password}
       </if>
+      <if test="personnelSsoId != null and personnelSsoId != ''">
+        or PERSONNEL_SSO_ID = #{personnelSsoId}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.RmsPersonnel">
     insert into RMS_PERSONNEL (PERSONNEL_ID, PERSONNEL_JOB_NUMBER, 
-      PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID,
+      PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, 
       PERSONNEL_WORKSHOPID, PERSONNEL_SHIFTS, PERSONNEL_TEAM, 
       INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
       UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID, 
-      DELETED, USERNAME, PASSWORD
-      )
+      DELETED, USERNAME, PASSWORD, 
+      PERSONNEL_SSO_ID)
     values (#{personnelId,jdbcType=DECIMAL}, #{personnelJobNumber,jdbcType=VARCHAR}, 
-      #{personnelPost,jdbcType=VARCHAR}, #{personnelName,jdbcType=VARCHAR}, #{departmentId,jdbcType=DECIMAL},
-      #{personnelWorkshopid,jdbcType=VARCHAR}, #{personnelShifts,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR}, 
+      #{personnelPost,jdbcType=VARCHAR}, #{personnelName,jdbcType=VARCHAR}, #{personnelDepartmentId,jdbcType=DECIMAL}, 
+      #{personnelWorkshopid,jdbcType=DECIMAL}, #{personnelShifts,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR}, 
       #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{easPersonnelId,jdbcType=DECIMAL}, 
-      #{deleted,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}
-      )
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{easPersonnelId,jdbcType=VARCHAR}, 
+      #{deleted,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
+      #{personnelSsoId,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
     insert into RMS_PERSONNEL
@@ -234,7 +245,7 @@
       <if test="personnelName != null">
         PERSONNEL_NAME,
       </if>
-      <if test="departmentId != null">
+      <if test="personnelDepartmentId != null">
         PERSONNEL_DEPARTMENT_ID,
       </if>
       <if test="personnelWorkshopid != null">
@@ -273,6 +284,9 @@
       <if test="password != null">
         PASSWORD,
       </if>
+      <if test="personnelSsoId != null">
+        PERSONNEL_SSO_ID,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="personnelId != null">
@@ -287,11 +301,11 @@
       <if test="personnelName != null">
         #{personnelName,jdbcType=VARCHAR},
       </if>
-      <if test="departmentId != null">
-        #{departmentId,jdbcType=DECIMAL},
+      <if test="personnelDepartmentId != null">
+        #{personnelDepartmentId,jdbcType=DECIMAL},
       </if>
       <if test="personnelWorkshopid != null">
-        #{personnelWorkshopid,jdbcType=VARCHAR},
+        #{personnelWorkshopid,jdbcType=DECIMAL},
       </if>
       <if test="personnelShifts != null">
         #{personnelShifts,jdbcType=VARCHAR},
@@ -315,7 +329,7 @@
         #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
       <if test="easPersonnelId != null">
-        #{easPersonnelId,jdbcType=DECIMAL},
+        #{easPersonnelId,jdbcType=VARCHAR},
       </if>
       <if test="deleted != null">
         #{deleted,jdbcType=DECIMAL},
@@ -326,6 +340,9 @@
       <if test="password != null">
         #{password,jdbcType=VARCHAR},
       </if>
+      <if test="personnelSsoId != null">
+        #{personnelSsoId,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsPersonnel">
@@ -333,8 +350,8 @@
     set PERSONNEL_JOB_NUMBER = #{personnelJobNumber,jdbcType=VARCHAR},
       PERSONNEL_POST = #{personnelPost,jdbcType=VARCHAR},
       PERSONNEL_NAME = #{personnelName,jdbcType=VARCHAR},
-      PERSONNEL_DEPARTMENT_ID = #{departmentId,jdbcType=DECIMAL},
-      PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=VARCHAR},
+      PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId,jdbcType=DECIMAL},
+      PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
       PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
       PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
       INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
@@ -342,10 +359,11 @@
       UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
       UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
       INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=DECIMAL},
+      EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=VARCHAR},
       DELETED = #{deleted,jdbcType=DECIMAL},
       USERNAME = #{username,jdbcType=VARCHAR},
-      PASSWORD = #{password,jdbcType=VARCHAR}
+      PASSWORD = #{password,jdbcType=VARCHAR},
+      PERSONNEL_SSO_ID = #{personnelSsoId,jdbcType=VARCHAR}
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
@@ -360,11 +378,11 @@
       <if test="personnelName != null">
         PERSONNEL_NAME = #{personnelName,jdbcType=VARCHAR},
       </if>
-      <if test="departmentId != null">
-        PERSONNEL_DEPARTMENT_ID = #{departmentId,jdbcType=DECIMAL},
+      <if test="personnelDepartmentId != null">
+        PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId,jdbcType=DECIMAL},
       </if>
       <if test="personnelWorkshopid != null">
-        PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=VARCHAR},
+        PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
       </if>
       <if test="personnelShifts != null">
         PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
@@ -388,7 +406,7 @@
         INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
       <if test="easPersonnelId != null">
-        EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=DECIMAL},
+        EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=VARCHAR},
       </if>
       <if test="deleted != null">
         DELETED = #{deleted,jdbcType=DECIMAL},
@@ -399,125 +417,132 @@
       <if test="password != null">
         PASSWORD = #{password,jdbcType=VARCHAR},
       </if>
+      <if test="personnelSsoId != null">
+        PERSONNEL_SSO_ID = #{personnelSsoId,jdbcType=VARCHAR},
+      </if>
     </set>
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into RMS_PERSONNEL 
       (PERSONNEL_ID, 
       PERSONNEL_JOB_NUMBER, PERSONNEL_POST, 
-      PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, PERSONNEL_WORKSHOPID,
-      PERSONNEL_SHIFTS, PERSONNEL_TEAM, 
-      INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID, 
-      DELETED, USERNAME, PASSWORD
-      )
+      PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, 
+      PERSONNEL_WORKSHOPID, PERSONNEL_SHIFTS, 
+      PERSONNEL_TEAM, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      EAS_PERSONNEL_ID, DELETED, USERNAME, 
+      PASSWORD, PERSONNEL_SSO_ID)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.personnelId,jdbcType=DECIMAL}, 
       #{item.personnelJobNumber,jdbcType=VARCHAR}, #{item.personnelPost,jdbcType=VARCHAR}, 
-      #{item.personnelName,jdbcType=VARCHAR}, #{item.departmentId,jdbcType=DECIMAL}, #{item.personnelWorkshopid,jdbcType=VARCHAR},
-      #{item.personnelShifts,jdbcType=VARCHAR}, #{item.personnelTeam,jdbcType=VARCHAR}, 
-      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.easPersonnelId,jdbcType=DECIMAL}, 
-      #{item.deleted,jdbcType=DECIMAL}, #{item.username,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}
-       from dual  
+      #{item.personnelName,jdbcType=VARCHAR}, #{item.personnelDepartmentId,jdbcType=DECIMAL}, 
+      #{item.personnelWorkshopid,jdbcType=DECIMAL}, #{item.personnelShifts,jdbcType=VARCHAR}, 
+      #{item.personnelTeam,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.easPersonnelId,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL}, #{item.username,jdbcType=VARCHAR}, 
+      #{item.password,jdbcType=VARCHAR}, #{item.personnelSsoId,jdbcType=VARCHAR} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
      update RMS_PERSONNEL
      set
        PERSONNEL_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelId,jdbcType=DECIMAL}
        </foreach>
        ,PERSONNEL_JOB_NUMBER=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelJobNumber,jdbcType=VARCHAR}
        </foreach>
        ,PERSONNEL_POST=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelPost,jdbcType=VARCHAR}
        </foreach>
        ,PERSONNEL_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelName,jdbcType=VARCHAR}
        </foreach>
        ,PERSONNEL_DEPARTMENT_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
-          when #{item.personnelId,jdbcType=DECIMAL} then #{item.departmentId,jdbcType=DECIMAL}
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
+          when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelDepartmentId,jdbcType=DECIMAL}
        </foreach>
        ,PERSONNEL_WORKSHOPID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
-          when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=VARCHAR}
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
+          when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=DECIMAL}
        </foreach>
        ,PERSONNEL_SHIFTS=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelShifts,jdbcType=VARCHAR}
        </foreach>
        ,PERSONNEL_TEAM=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelTeam,jdbcType=VARCHAR}
        </foreach>
        ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
        </foreach>
        ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
        </foreach>
        ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
        </foreach>
        ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
        </foreach>
        ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
        </foreach>
        ,EAS_PERSONNEL_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
-          when #{item.personnelId,jdbcType=DECIMAL} then #{item.easPersonnelId,jdbcType=DECIMAL}
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
+          when #{item.personnelId,jdbcType=DECIMAL} then #{item.easPersonnelId,jdbcType=VARCHAR}
        </foreach>
        ,DELETED=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
        </foreach>
        ,USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.username,jdbcType=VARCHAR}
        </foreach>
        ,PASSWORD=
-       <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
           when #{item.personnelId,jdbcType=DECIMAL} then #{item.password,jdbcType=VARCHAR}
        </foreach>
+       ,PERSONNEL_SSO_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
+          when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelSsoId,jdbcType=VARCHAR}
+       </foreach>
      where PERSONNEL_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
     #{item.personnelId,jdbcType=DECIMAL}
      </foreach> 
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from RMS_PERSONNEL
     where PERSONNEL_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
@@ -607,24 +632,54 @@
 
   <!--    根据id值展示人员信息-->
   <select id="selectPersonnelById"  resultType="java.util.LinkedHashMap">
-        SELECT
-        RP.PERSONNEL_ID AS "personnelId",
-        RP.PERSONNEL_DEPARTMENT_ID AS "departmentId",
-        RP.PERSONNEL_JOB_NUMBER AS "personnelJobNumber",
-        RP.PERSONNEL_NAME AS "personnelName",
-        RP.PERSONNEL_POST AS "personnelPost",
-        RP.PERSONNEL_WORKSHOPID AS "personnelWorkshopid",
-        RP.PERSONNEL_SHIFTS AS "personnelShifts",
-        RP.PERSONNEL_TEAM AS "personnelTeam"
-        FROM RMS_PERSONNEL RP
-        WHERE RP.PERSONNEL_ID=#{id}
-    </select>
+    SELECT
+      RP.PERSONNEL_ID AS "personnelId",
+      RP.PERSONNEL_DEPARTMENT_ID AS "departmentId",
+      RP.PERSONNEL_JOB_NUMBER AS "personnelJobNumber",
+      RP.PERSONNEL_NAME AS "personnelName",
+      RP.PERSONNEL_POST AS "personnelPost",
+      RP.PERSONNEL_WORKSHOPID AS "personnelWorkshopid",
+      RP.PERSONNEL_SHIFTS AS "personnelShifts",
+      RP.PERSONNEL_TEAM AS "personnelTeam"
+    FROM RMS_PERSONNEL RP
+    WHERE RP.PERSONNEL_ID=#{id}
+  </select>
   <!--    获得托运人信息-->
   <select id="getShipperId" resultType="java.util.LinkedHashMap">
-        SELECT  RS.SHIPPER_ID AS "id",
-                RS.SHIPPER_ID AS "value",
-                RS.SHIPPER_NAME AS "label"
-        FROM RMS_SHIPPER RS
-        WHERE RS.DELETED!=1
-    </select>
+    SELECT  RS.SHIPPER_ID AS "id",
+            RS.SHIPPER_ID AS "value",
+            RS.SHIPPER_NAME AS "label"
+    FROM RMS_SHIPPER RS
+    WHERE RS.DELETED!=1
+  </select>
+
+  <!--    获得托运人信息-->
+  <select id="getSecondShipper" resultType="java.util.LinkedHashMap">
+    SELECT  RS.SHIPPER_ID AS "id",
+            RS.SHIPPER_ID AS "value",
+            RS.SHIPPER_NAME AS "label",
+            RS.SHIPPER_SSO_ID AS "shipperSsoId"
+    FROM RMS_SHIPPER RS
+    WHERE RS.SHIPPER_DEPARTMENT_LEVEL = 'LV2'
+  </select>
+
+  <!--    获得托运人信息-->
+  <select id="getThirdShipper" resultType="java.util.LinkedHashMap">
+    SELECT  RS.SHIPPER_ID AS "id",
+            RS.SHIPPER_ID AS "value",
+            RS.SHIPPER_NAME AS "label",
+            RS.SHIPPER_SSO_ID AS "shipperSsoId"
+    FROM RMS_SHIPPER RS
+    WHERE RS.SHIPPER_DEPARTMENT_LEVEL = 'LV3'
+      AND RS.SHIPPER_FATHER_ID = #{shipperId}
+  </select>
+
+  <!-- 查询sso主键以及机构编码 -->
+  <select id="getShipperMap" parameterType="DECIMAL" resultType="java.util.Map" >
+    SELECT
+        RS.SHIPPER_SSO_ID AS "shipperSsoId",
+        RS.SHIPPER_ORG_CODE AS "shipperOrgCode"
+FROM RMS_SHIPPER RS
+WHERE RS.SHIPPER_ID = #{shipperId}
+  </select>
 </mapper>