Administrator
2024-01-20 d4fabb188a2426c3e0a0d13074c81c7b9f54ca97
2024-01-20 朱宝民 用户实体类id改为userId
3个文件已修改
30 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java
@@ -51,9 +51,9 @@
    ASSIGN_UUID(4), //全局唯一的 uuid
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @TableId(value = "id", type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Long id;
    public Long userId;
    @Schema(description = "所属片区ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -6,7 +6,7 @@
    <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser">
        <!--@mbg.generated-->
        <!--@Table ba_user-->
        <id property="id" column="id" />
        <id property="userId" column="id" />
        <result property="blockId" column="blockId"/>
        <result property="userName" column="name"/>
        <result property="phone" column="phone"/>
@@ -20,7 +20,7 @@
    <resultMap id="partResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser">
        <!--@mbg.generated-->
        <!--@Table ba_user-->
        <id property="id" column="id" />
        <id property="userId" column="id" />
        <result property="userName" column="name"/>
        <result property="phone" column="phone"/>
        <result property="orgTag" column="orgTag"/>
@@ -29,7 +29,7 @@
    </resultMap>
    <resultMap id="loginResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser">
        <id property="id" column="id" />
        <id property="userId" column="id" />
        <result property="blockId" column="blockId"/>
        <result property="userName" column="name"/>
        <result property="phone" column="phone"/>
@@ -100,7 +100,7 @@
    </select>
    <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser">
        insert into ba_user (<include refid="Base_Column_List" />)
        values (#{id,jdbcType=BIGINT},
        values (#{userId,jdbcType=BIGINT},
        #{blockId,jdbcType=BIGINT},
        #{userName,jdbcType=VARCHAR},
        #{phone,jdbcType=VARCHAR},
@@ -114,7 +114,7 @@
    <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser">
        insert into ba_user
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
            <if test="userId != null">
                id,
            </if>
            <if test="blockId != null">
@@ -143,8 +143,8 @@
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            <if test="userId != null">
                #{userId,jdbcType=BIGINT},
            </if>
            <if test="blockId != null">
                #{blockId,jdbcType=BIGINT},
@@ -195,7 +195,7 @@
                deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
        where id = #{userId, jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser">
        update ba_user
@@ -205,7 +205,7 @@
        password = #{password,jdbcType=VARCHAR},
        disabled = #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
        deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}
        where id = #{id,jdbcType=BIGINT}
        where id = #{userId,jdbcType=BIGINT}
    </update>
    <update id="changePassword" >
        update ba_user
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -142,7 +142,7 @@
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        po.id = null;
        po.userId = null;
        int count;
        try {
            po.supperAdmin = Constant.no.byteValue() ;
@@ -159,7 +159,7 @@
                po.password = MD5.encrypt(defaultPassword);
            }
            count = this.sv.save(po);
            this.sv.setRoles(po.id, po.roleIds);
            this.sv.setRoles(po.userId, po.roleIds);
        } catch (Exception e) {
            log.error("保存用户异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
@@ -192,7 +192,7 @@
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        if (po.id == null) {
        if (po.userId == null) {
            return BaseResponseUtils.buildFail("无数据实体ID");
        }
        int count;
@@ -201,7 +201,7 @@
            po.deleted = null;//设置为null,不做更新
            po.orgTag = null;//设置为null,不做更新
            count = this.sv.update(po);
            this.sv.setRoles(po.id, po.roleIds);
            this.sv.setRoles(po.userId, po.roleIds);
        } catch (Exception e) {
            log.error("保存用户异常", e);
            return BaseResponseUtils.buildException(e.getMessage());