lidongdong
2023-04-07 4fd5d868a3e3b28bf6f55a1aa12212db70e1550f
修改  微服务新增报错
3个文件已修改
96 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComFmsServiceDAO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComFmsServiceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComFmsServiceMapper.xml 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComFmsServiceDAO.java
@@ -14,6 +14,7 @@
import com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO;
import com.panzhihua.common.model.vos.community.fms.FmsServiceTopStatisticsVO;
import com.panzhihua.common.model.vos.grid.EventVO;
import com.panzhihua.service_community.entity.ComFmsServiceRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import com.panzhihua.service_community.entity.ComFmsService;
@@ -36,6 +37,7 @@
     */
    int insertBatch(@Param("entities") List<ComFmsService> entities);
    int addBracelet(@Param("entitie") ComFmsService entities);
    /**
     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
     *
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComFmsServiceServiceImpl.java
@@ -294,7 +294,7 @@
        comFmsService.setUserId(userInfo.getUserId());
        comFmsService.setUserName(userInfo.getNickName());
        comFmsService.setPhone(userInfo.getPhone());
        int num = this.baseMapper.insert(comFmsService);
        int num = this.baseMapper.addBracelet(comFmsService);
        if (num > 0) {
//            ComFmsServiceRecord comFmsServiceRecord = new ComFmsServiceRecord();
//            comFmsServiceRecord.setServiceId(comFmsService.getId());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComFmsServiceMapper.xml
@@ -29,6 +29,98 @@
        (#{entity.userName}, #{entity.userId}, #{entity.phone}, #{entity.serviceContent}, #{entity.serviceImage}, #{entity.approvalContent}, #{entity.approvalAt}, #{entity.memberId}, #{entity.serviceStatus}, #{entity.serviceAt}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}, #{entity.communityId})
        </foreach>
    </insert>
    <insert id="addBracelet" parameterType="com.panzhihua.service_community.entity.ComFmsService" >
        insert into bracelet_user_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="entitie.userName != null">
                user_name,
            </if>
            <if test="entitie.userId != null">
                user_id,
            </if>
            <if test="entitie.phone != null">
                phone,
            </if>
            <if test="entitie.serviceContent != null">
                service_content,
            </if>
            <if test="entitie.serviceImage != null">
                service_image,
            </if>
            <if test="entitie.approvalContent != null">
                approval_content,
            </if>
            <if test="entitie.approvalAt != null">
                approval_at,
            </if>
            <if test="entitie.memberId != null">
                member_id,
            </if>
            <if test="entitie.serviceStatus != null">
                service_status,
            </if>
            <if test="entitie.serviceAt != null">
                service_at,
            </if>
            <if test="entitie.createdBy != null">
                created_by,
            </if>
            <if test="entitie.updatedBy != null">
                updated_by,
            </if>
            <if test="entitie.communityId != null">
                community_id,
            </if>
            created_at
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="entitie.userName != null">
                #{entitie.userName},
            </if>
            <if test="entitie.userId != null">
                #{entitie.userId},
            </if>
            <if test="entitie.phone != null">
                #{entitie.phone},
            </if>
            <if test="entitie.serviceContent != null">
                #{entitie.serviceContent},
            </if>
            <if test="entitie.serviceImage != null">
                #{entitie.serviceImage},
            </if>
            <if test="entitie.approvalContent != null">
                #{entitie.approvalContent},
            </if>
            <if test="entitie.approvalAt != null">
                #{entitie.approvalAt},
            </if>
            <if test="entitie.memberId != null">
                #{entitie.memberId},
            </if>
            <if test="entitie.serviceStatus != null">
                #{entitie.serviceStatus},
            </if>
            <if test="entitie.serviceAt != null">
                #{entitie.serviceAt},
            </if>
            <if test="entitie.createdBy != null">
                #{entitie.createdBy},
            </if>
            <if test="entitie.updatedBy != null">
                #{entitie.updatedBy},
            </if>
            <if test="entitie.communityId != null">
                #{entitie.communityId},
            </if>
            sysdate()
        </trim>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into smart_life.com_fms_service(user_name, user_id, phone, service_content, service_image, approval_content, approval_at, member_id, service_status, service_at, created_at, created_by, updated_at, updated_by, community_id)