Procházet zdrojové kódy

”修改新增用户“

zx před 3 roky
rodič
revize
e357e02397

+ 1 - 1
pom.xml

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

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

@@ -86,8 +86,8 @@ public class RmsPersonnelController extends BaseRESTfulController {
     @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = false, dataType = "RmsPersonnel")
     //@RequiresPermissions("rmspersonnel:create")
     @PostMapping(value = "/insertPersonnel")
-    public RESTfulResult insertPersonnel(@RequestBody RmsPersonnel rmsPersonnel){
-        int result=rmsPersonnelService.insertPersonnel(rmsPersonnel);
+    public RESTfulResult insertPersonnel(@RequestBody(required = false) Map<String,Object> map){
+        int result=rmsPersonnelService.insertPersonnel(map);
         if (result <= 0){
             return failed();
         }
@@ -187,13 +187,13 @@ public class RmsPersonnelController extends BaseRESTfulController {
 
     /**
      * 新增人员权限
-     * @param rmsPersonnel
+     * @param map
      * @return
      */
     @ApiOperation(value="创建", notes="RmsPersonnel对象创建")
     @PostMapping(value = "/addPersonnel")
-    public RESTfulResult addPersonnel(@RequestBody RmsPersonnel rmsPersonnel){
-        int result = rmsPersonnelService.addPersonnel(rmsPersonnel);
+    public RESTfulResult addPersonnel(@RequestBody(required = false) Map<String,Object> map){
+        int result = rmsPersonnelService.addPersonnel(map);
         if (result <= 0){
             return failed();
         }

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

@@ -32,4 +32,7 @@ public interface RmsPersonnelMapper extends IBaseMapper<RmsPersonnel, BigDecimal
     List<Map<String, Object>> getThirdShipper(BigDecimal shipperId);
 // 查询sso主键和机构编码
     Map<String, Object> getShipperMap(BigDecimal shipperId);
+
+    //通过用户名和账号判断是否存在
+   BigDecimal getPersonnelIdByJobNumber(Map<String,Object> map);
 }

+ 15 - 0
src/main/java/com/steerinfo/dil/model/RmsPersonnel.java

@@ -117,6 +117,12 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="SSO主键",required=false)
     private String personnelSsoId;
 
+    /**
+     * 联系电话(PERSONNEL_CONTACT_NUMBER,VARCHAR,100)
+     */
+    @ApiModelProperty(value="联系电话",required=false)
+    private String personnelContactNumber;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -273,6 +279,14 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         this.personnelSsoId = personnelSsoId == null ? null : personnelSsoId.trim();
     }
 
+    public String getPersonnelContactNumber() {
+        return personnelContactNumber;
+    }
+
+    public void setPersonnelContactNumber(String personnelContactNumber) {
+        this.personnelContactNumber = personnelContactNumber == null ? null : personnelContactNumber.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -297,6 +311,7 @@ public class RmsPersonnel implements IBasePO<BigDecimal> {
         sb.append(", username=").append(username);
         sb.append(", password=").append(password);
         sb.append(", personnelSsoId=").append(personnelSsoId);
+        sb.append(", personnelContactNumber=").append(personnelContactNumber);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -26,7 +26,7 @@ public interface IRmsPersonnelService {
 //    获取人员信息
     List<Map<String, Object>> getPersonnelList(Map<String, Object> mapVal);
 //增加人员信息
-    int insertPersonnel(RmsPersonnel rmsPersonnel);
+    int insertPersonnel(Map<String,Object> map);
 //更新人员信息
     int updatePersonnel(RmsPersonnel rmsPersonnel);
 //删除人员信息
@@ -43,7 +43,7 @@ public interface IRmsPersonnelService {
     List<Map<String,Object>> getThirdShipper(BigDecimal shipperId);
 
     // 新增人员权限
-    int addPersonnel(RmsPersonnel rmsPersonnel);
+    int addPersonnel(Map<String,Object> map);
 
     // 查询SSO主键和机构编码
     Map<String,Object> getShipperMap(BigDecimal shipperId);

+ 63 - 39
src/main/java/com/steerinfo/dil/service/impl/RmsPersonnelServiceImpl.java

@@ -5,6 +5,7 @@ import com.steerinfo.dil.mapper.RmsShipperMapper;
 import com.steerinfo.dil.model.RmsPersonnel;
 import com.steerinfo.dil.model.RmsShipper;
 import com.steerinfo.dil.service.IRmsPersonnelService;
+import com.steerinfo.dil.util.DataChange;
 import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -99,38 +100,39 @@ public class RmsPersonnelServiceImpl implements IRmsPersonnelService {
 
     /**
      * 添加人员信息
-     * @param rmsPersonnel
+     * @param map
      * @return
      */
     @Override
-    public int insertPersonnel(RmsPersonnel rmsPersonnel) {
-//        获取到用户名以及使用默认密码
-        String username=rmsPersonnel.getUsername();
-        String password="123456";
-
-
+    public int insertPersonnel(Map<String,Object> map) {
+        RmsPersonnel rmsPersonnel=new RmsPersonnel();
+        String personnelSsoId = (String) map.get("personnelSsoId");
+        String personnelTeam = (String) map.get("personnelTeam");
+        String personnelShifts =(String) map.get("personnelShifts");
+        String userId =(String) map.get("userId");
+        String concatTelephone =(String) map.get("ConcatTelephone");
+        String personnelJobNumber = (String) map.get("personnelJobNumber");
+        String personnelPost =(String) map.get("personnelPost");
+        String personnelName = (String) map.get("personnelName");
+        BigDecimal personnelDepartmentId = DataChange.dataToBigDecimal(map.get("personnelDepartmentId"));
         int i=0;
-        String personnelJobNumber=rmsPersonnel.getPersonnelJobNumber();
-        Map<String, Object> map=new HashMap<>();
-        map.put("personnelJobNumber",personnelJobNumber);
-        List<RmsPersonnel> rmsPersonnels=rmsPersonnelMapper.selectByParameters(map);
-        if (rmsPersonnels.size()!=0){
-            RmsPersonnel rmsPersonnel1=rmsPersonnels.get(0);
-            if (rmsPersonnel1.getDeleted().equals(new BigDecimal(1))){
-                rmsPersonnel.setInsertUsername("admin");
-                rmsPersonnel.setDeleted(new BigDecimal(0));
-                rmsPersonnel.setPersonnelId(rmsPersonnelMapper.getPersonnelId());
-                i+= rmsPersonnelMapper.insertSelective(rmsPersonnel);
-            }
-            else{
-                i=-1;
-            }
-        }
-        else {
-            rmsPersonnel.setInsertTime(new Date());
-            rmsPersonnel.setInsertUsername("admin");
-            rmsPersonnel.setDeleted(new BigDecimal(0));
+        //判断用户是否存在系统
+        BigDecimal personnelId = rmsPersonnelMapper.getPersonnelIdByJobNumber(map);
+        if (personnelId!=null&&!"null".equals(personnelId)&&personnelId.intValue()!=0){
+           return  -1;
+        }else {
+            //执行新增
             rmsPersonnel.setPersonnelId(rmsPersonnelMapper.getPersonnelId());
+            rmsPersonnel.setPersonnelJobNumber(personnelJobNumber);
+            rmsPersonnel.setPersonnelContactNumber(concatTelephone);
+            rmsPersonnel.setPersonnelName(personnelName);
+            rmsPersonnel.setPersonnelTeam(personnelTeam);
+            rmsPersonnel.setPersonnelPost(personnelPost);
+            rmsPersonnel.setPersonnelDepartmentId(personnelDepartmentId);
+            rmsPersonnel.setPersonnelSsoId(personnelSsoId);
+            rmsPersonnel.setPersonnelShifts(personnelShifts);
+            rmsPersonnel.setInsertUsername(userId);
+            rmsPersonnel.setInsertTime(new Date());
             i+= rmsPersonnelMapper.insertSelective(rmsPersonnel);
         }
         return i;
@@ -199,21 +201,43 @@ public class RmsPersonnelServiceImpl implements IRmsPersonnelService {
 
     /**
      * 新增人员权限
-     * @param rmsPersonnel
+     * @param map
      * @return
      */
     @Override
-    public int addPersonnel(RmsPersonnel rmsPersonnel) {
-        int result = 0;
-        String personnelJobNumber = rmsPersonnel.getPersonnelJobNumber();
-        BigDecimal personnelId = rmsPersonnelMapper.getPersonnelId();
-        rmsPersonnel.setPersonnelId(personnelId);
-        rmsPersonnel.setPersonnelJobNumber(personnelJobNumber);
-        rmsPersonnel.setDeleted(new BigDecimal(0));
-        rmsPersonnel.setInsertTime(new Date());
-        rmsPersonnel.setInsertUsername("admin");
-        result += rmsPersonnelMapper.insertSelective(rmsPersonnel);
-        return result;
+    public int addPersonnel(Map<String,Object> map) {
+        RmsPersonnel rmsPersonnel=new RmsPersonnel();
+        String personnelSsoId = (String) map.get("personnelSsoId");
+        String personnelTeam = (String) map.get("personnelTeam");
+        String personnelShifts =(String) map.get("personnelShifts");
+        String userId =(String) map.get("userId");
+        String concatTelephone =(String) map.get("ConcatTelephone");
+        String personnelJobNumber = (String) map.get("personnelJobNumber");
+        String personnelPost =(String) map.get("personnelPost");
+        String personnelName = (String) map.get("personnelName");
+        BigDecimal personnelDepartmentId = DataChange.dataToBigDecimal(map.get("personnelDepartmentId"));
+        int i=0;
+        //判断用户是否存在系统
+        BigDecimal personnelId = rmsPersonnelMapper.getPersonnelIdByJobNumber(map);
+        if (personnelId!=null&&!"null".equals(personnelId)&&personnelId.intValue()!=0){
+            return  -1;
+        }else {
+            //执行新增
+            rmsPersonnel.setPersonnelId(rmsPersonnelMapper.getPersonnelId());
+            rmsPersonnel.setPersonnelJobNumber(personnelJobNumber);
+            rmsPersonnel.setPersonnelContactNumber(concatTelephone);
+            rmsPersonnel.setPersonnelName(personnelName);
+            rmsPersonnel.setPersonnelTeam(personnelTeam);
+            rmsPersonnel.setPersonnelPost(personnelPost);
+            rmsPersonnel.setPersonnelDepartmentId(personnelDepartmentId);
+            rmsPersonnel.setPersonnelSsoId(personnelSsoId);
+            rmsPersonnel.setPersonnelShifts(personnelShifts);
+            rmsPersonnel.setInsertUsername(userId);
+            rmsPersonnel.setInsertTime(new Date());
+            rmsPersonnel.setDeleted(new BigDecimal(0));
+            i+= rmsPersonnelMapper.insertSelective(rmsPersonnel);
+        }
+        return i;
     }
 
     /**

+ 6 - 5
src/main/resources/bootstrap.yml

@@ -16,16 +16,17 @@ spring:
 eureka:
   client:
     service-url:
-      defaultZone: http://root:root@${EUREKA_HOST:172.16.33.162}:${EUREKA_PORT:8081}/eureka/
-    registerWithEureka:
-      false
-    fetchRegistry:
-      false
+      defaultZone: http://root:root@${EUREKA_HOST:172.16.33.166}:${EUREKA_PORT:8081}/eureka/
+    register-with-eureka: false #表示向EurekaServer注册自己 默认为true
+    fetch-registry: false #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
+
   instance:
     prefer-ip-address: true
     status-page-url: http://${spring.cloud.client.ip-address}:${server.port}/swagger-ui.html#/
     instance-id: ${spring.cloud.client.ip-address}:${server.port}
 
+
+
 genxml:
   pth: com/a
 cache:

+ 232 - 199
src/main/resources/com/steerinfo/dil/mapper/RmsPersonnelMapper.xml

@@ -20,18 +20,19 @@
     <result column="USERNAME" jdbcType="VARCHAR" property="username" />
     <result column="PASSWORD" jdbcType="VARCHAR" property="password" />
     <result column="PERSONNEL_SSO_ID" jdbcType="VARCHAR" property="personnelSsoId" />
+    <result column="PERSONNEL_CONTACT_NUMBER" jdbcType="VARCHAR" property="personnelContactNumber" />
   </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_SSO_ID
+    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, PERSONNEL_CONTACT_NUMBER
   </sql>
   <sql id="columns_alias">
-    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.PERSONNEL_SSO_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.PERSONNEL_SSO_ID, t.PERSONNEL_CONTACT_NUMBER
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_PERSONNEL
@@ -40,7 +41,7 @@
     SELECT <include refid="columns_alias" /> FROM RMS_PERSONNEL t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="personnelId != null">
         and PERSONNEL_ID = #{personnelId}
       </if>
@@ -95,10 +96,13 @@
       <if test="personnelSsoId != null and personnelSsoId != ''">
         and PERSONNEL_SSO_ID = #{personnelSsoId}
       </if>
+      <if test="personnelContactNumber != null and personnelContactNumber != ''">
+        and PERSONNEL_CONTACT_NUMBER = #{personnelContactNumber}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="personnelId != null">
         and PERSONNEL_ID = #{personnelId}
       </if>
@@ -153,6 +157,9 @@
       <if test="personnelSsoId != null and personnelSsoId != ''">
         and PERSONNEL_SSO_ID LIKE '%${personnelSsoId}%'
       </if>
+      <if test="personnelContactNumber != null and personnelContactNumber != ''">
+        and PERSONNEL_CONTACT_NUMBER LIKE '%${personnelContactNumber}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
@@ -161,74 +168,77 @@
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from RMS_PERSONNEL
-    where 1!=1 
-      <if test="personnelJobNumber != null and personnelJobNumber != ''">
-        or PERSONNEL_JOB_NUMBER = #{personnelJobNumber}
-      </if>
-      <if test="personnelPost != null and personnelPost != ''">
-        or PERSONNEL_POST = #{personnelPost}
-      </if>
-      <if test="personnelName != null and personnelName != ''">
-        or PERSONNEL_NAME = #{personnelName}
-      </if>
-      <if test="personnelDepartmentId != null">
-        or PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId}
-      </if>
-      <if test="personnelWorkshopid != null">
-        or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
-      </if>
-      <if test="personnelShifts != null and personnelShifts != ''">
-        or PERSONNEL_SHIFTS = #{personnelShifts}
-      </if>
-      <if test="personnelTeam != null and personnelTeam != ''">
-        or PERSONNEL_TEAM = #{personnelTeam}
-      </if>
-      <if test="insertUsername != null and insertUsername != ''">
-        or INSERT_USERNAME = #{insertUsername}
-      </if>
-      <if test="insertTime != null">
-        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-      </if>
-      <if test="updateUsername != null and updateUsername != ''">
-        or UPDATE_USERNAME = #{updateUsername}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-      </if>
-      <if test="easPersonnelId != null and easPersonnelId != ''">
-        or EAS_PERSONNEL_ID = #{easPersonnelId}
-      </if>
-      <if test="deleted != null">
-        or DELETED = #{deleted}
-      </if>
-      <if test="username != null and username != ''">
-        or USERNAME = #{username}
-      </if>
-      <if test="password != null and password != ''">
-        or PASSWORD = #{password}
-      </if>
-      <if test="personnelSsoId != null and personnelSsoId != ''">
-        or PERSONNEL_SSO_ID = #{personnelSsoId}
-      </if>
+    where 1!=1
+    <if test="personnelJobNumber != null and personnelJobNumber != ''">
+      or PERSONNEL_JOB_NUMBER = #{personnelJobNumber}
+    </if>
+    <if test="personnelPost != null and personnelPost != ''">
+      or PERSONNEL_POST = #{personnelPost}
+    </if>
+    <if test="personnelName != null and personnelName != ''">
+      or PERSONNEL_NAME = #{personnelName}
+    </if>
+    <if test="personnelDepartmentId != null">
+      or PERSONNEL_DEPARTMENT_ID = #{personnelDepartmentId}
+    </if>
+    <if test="personnelWorkshopid != null">
+      or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
+    </if>
+    <if test="personnelShifts != null and personnelShifts != ''">
+      or PERSONNEL_SHIFTS = #{personnelShifts}
+    </if>
+    <if test="personnelTeam != null and personnelTeam != ''">
+      or PERSONNEL_TEAM = #{personnelTeam}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="easPersonnelId != null and easPersonnelId != ''">
+      or EAS_PERSONNEL_ID = #{easPersonnelId}
+    </if>
+    <if test="deleted != null">
+      or DELETED = #{deleted}
+    </if>
+    <if test="username != null and username != ''">
+      or USERNAME = #{username}
+    </if>
+    <if test="password != null and password != ''">
+      or PASSWORD = #{password}
+    </if>
+    <if test="personnelSsoId != null and personnelSsoId != ''">
+      or PERSONNEL_SSO_ID = #{personnelSsoId}
+    </if>
+    <if test="personnelContactNumber != null and personnelContactNumber != ''">
+      or PERSONNEL_CONTACT_NUMBER = #{personnelContactNumber}
+    </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_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)
-    values (#{personnelId,jdbcType=DECIMAL}, #{personnelJobNumber,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=VARCHAR}, 
-      #{deleted,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
-      #{personnelSsoId,jdbcType=VARCHAR})
+    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_SSO_ID, PERSONNEL_CONTACT_NUMBER)
+    values (#{personnelId,jdbcType=DECIMAL}, #{personnelJobNumber,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=VARCHAR},
+            #{deleted,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
+            #{personnelSsoId,jdbcType=VARCHAR}, #{personnelContactNumber,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
     insert into RMS_PERSONNEL
@@ -287,6 +297,9 @@
       <if test="personnelSsoId != null">
         PERSONNEL_SSO_ID,
       </if>
+      <if test="personnelContactNumber != null">
+        PERSONNEL_CONTACT_NUMBER,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="personnelId != null">
@@ -343,27 +356,31 @@
       <if test="personnelSsoId != null">
         #{personnelSsoId,jdbcType=VARCHAR},
       </if>
+      <if test="personnelContactNumber != null">
+        #{personnelContactNumber,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsPersonnel">
     update RMS_PERSONNEL
     set PERSONNEL_JOB_NUMBER = #{personnelJobNumber,jdbcType=VARCHAR},
-      PERSONNEL_POST = #{personnelPost,jdbcType=VARCHAR},
-      PERSONNEL_NAME = #{personnelName,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},
-      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=VARCHAR},
-      DELETED = #{deleted,jdbcType=DECIMAL},
-      USERNAME = #{username,jdbcType=VARCHAR},
-      PASSWORD = #{password,jdbcType=VARCHAR},
-      PERSONNEL_SSO_ID = #{personnelSsoId,jdbcType=VARCHAR}
+        PERSONNEL_POST = #{personnelPost,jdbcType=VARCHAR},
+        PERSONNEL_NAME = #{personnelName,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},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=VARCHAR},
+        DELETED = #{deleted,jdbcType=DECIMAL},
+        USERNAME = #{username,jdbcType=VARCHAR},
+        PASSWORD = #{password,jdbcType=VARCHAR},
+        PERSONNEL_SSO_ID = #{personnelSsoId,jdbcType=VARCHAR},
+        PERSONNEL_CONTACT_NUMBER = #{personnelContactNumber,jdbcType=VARCHAR}
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
@@ -420,10 +437,13 @@
       <if test="personnelSsoId != null">
         PERSONNEL_SSO_ID = #{personnelSsoId,jdbcType=VARCHAR},
       </if>
+      <if test="personnelContactNumber != null">
+        PERSONNEL_CONTACT_NUMBER = #{personnelContactNumber,jdbcType=VARCHAR},
+      </if>
     </set>
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
     <include refid="select" />
     where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
   </select>
@@ -436,112 +456,118 @@
     <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_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.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 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_SSO_ID, PERSONNEL_CONTACT_NUMBER
+    )
+    ( <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.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}, #{item.personnelContactNumber,jdbcType=VARCHAR}
+    from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update RMS_PERSONNEL
-     set
-       PERSONNEL_ID=
-       <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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 close=")" collection="list" index="index" item="item" open="(" separator=",">
-    #{item.personnelId,jdbcType=DECIMAL}
-     </foreach> 
+    update RMS_PERSONNEL
+    set
+    PERSONNEL_ID=
+    <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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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>
+    ,PERSONNEL_CONTACT_NUMBER=
+    <foreach close="end" collection="list" index="index" item="item" open="case PERSONNEL_ID" separator=" ">
+      when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelContactNumber,jdbcType=VARCHAR}
+    </foreach>
+    where PERSONNEL_ID in
+    <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 
+    where PERSONNEL_ID in
     <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
@@ -562,7 +588,8 @@
     RP.PERSONNEL_SHIFTS AS "personnelShifts",
     RS.SHIPPER_ID AS "shipperId",
     RP.PERSONNEL_DEPARTMENT_ID AS "departmentId",
-    RP.PERSONNEL_TEAM AS "personnelTeam"
+    RP.PERSONNEL_TEAM AS "personnelTeam",
+    RP.PERSONNEL_CONTACT_NUMBER "concactNumber"
     FROM RMS_PERSONNEL RP
     LEFT JOIN RMS_SHIPPER RS
     ON RP.PERSONNEL_DEPARTMENT_ID=RS.SHIPPER_ID
@@ -677,10 +704,10 @@
   <!-- 查询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}
+      RS.SHIPPER_SSO_ID AS "shipperSsoId",
+      RS.SHIPPER_ORG_CODE AS "shipperOrgCode"
+    FROM RMS_SHIPPER RS
+    WHERE RS.SHIPPER_ID = #{shipperId}
   </select>
   <select id="selectByParametersPersonnelJobNumber" resultType="java.lang.Integer">
     SELECT RP.PERSONNEL_ID
@@ -688,4 +715,10 @@ WHERE RS.SHIPPER_ID = #{shipperId}
     WHERE RP.PERSONNEL_JOB_NUMBER = #{personnelJobNumber}
       AND RP.DELETED =0
   </select>
+  <select id="getPersonnelIdByJobNumber" resultType="java.math.BigDecimal">
+    select COUNT(RP.PERSONNEL_ID)
+    from RMS_PERSONNEL RP
+    WHERE  RP.PERSONNEL_JOB_NUMBER=#{personnelJobNumber} and RP.PERSONNEL_NAME=#{personnelName} and RP.DELETED=0
+  </select>
+
 </mapper>