lidongdong
2022-10-26 fbb8d1d3c31ffc2333db8834dae55650490a1a57
Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
3个文件已修改
97 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDpcDAO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDpcServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDpcMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDpcDAO.java
@@ -62,4 +62,9 @@
     * @return
     */
    SysUserVO selectUser(@Param("phone") String phone);
    /**
     * 插入一条人大代表记录
     * */
    int insertComActDpc(@Param("comActDpc") ComActDpc comActDpc);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDpcServiceImpl.java
@@ -22,6 +22,7 @@
import com.panzhihua.service_community.service.ComActDpcService;
import javax.annotation.Resource;
import java.util.Date;
/**
 * 人大代表(ComActDpc)表服务实现类
@@ -34,6 +35,8 @@
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @Resource
    private ComActDpcDAO comActDpcDAO;
    /**
     * 新增人大代表
@@ -54,8 +57,9 @@
        }
        dpc = new ComActDpc();
        dpc.setId(Snowflake.getId());
        dpc.setCreatedAt(new Date());
        BeanUtils.copyProperties(addDpcDTO, dpc);
        int result = this.baseMapper.insert(dpc);
        int result = comActDpcDAO.insertComActDpc(dpc);
        if (result > 0) {
            refreshAssociateUserCash(addDpcDTO.getPhone());
            return R.ok();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDpcMapper.xml
@@ -64,6 +64,92 @@
        SELECT user_id, `name`, phone
        FROM sys_user WHERE `type` = 1 AND phone = #{phone}
    </select>
    <insert id="insertComActDpc">
        insert into com_act_dpc
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="comActDpc.id != null">
                id,
            </if>
            <if test="comActDpc.name != null and comActDpc.name != ''">
                name,
            </if>
            <if test="comActDpc.phone != null and comActDpc.phone != ''">
                phone,
            </if>
            <if test="comActDpc.nation != null and comActDpc.nation != ''">
            nation,
            </if>
            <if test="comActDpc.sex != null">
                sex,
            </if>
            <if test="comActDpc.area != null and comActDpc.area != ''">
                area,
            </if>
            <if test="comActDpc.belong != null and comActDpc.belong != ''">
                belong,
            </if>
            <if test="comActDpc.category != null and comActDpc.category != ''">
                category,
            </if>
            <if test="comActDpc.position != null and comActDpc.position != ''">
                position,
            </if>
            <if test="comActDpc.photo != null and comActDpc.photo != ''">
                photo,
            </if>
            <if test="comActDpc.communityId != null">
                community_id,
            </if>
            <if test="comActDpc.createdBy != null ">
                created_by,
            </if>
            <if test="comActDpc.createdAt != null ">
                created_at,
            </if>
        </trim>
        values
        <trim prefix="("  suffix=")" suffixOverrides=",">
            <if test="comActDpc.id != null">
                #{comActDpc.id},
            </if>
            <if test="comActDpc.name != null and comActDpc.name != ''">
                #{comActDpc.name},
            </if>
            <if test="comActDpc.phone != null and comActDpc.phone != ''">
                #{comActDpc.phone},
            </if>
            <if test="comActDpc.nation != null and comActDpc.nation != ''">
              #{comActDpc.nation},
            </if>
            <if test="comActDpc.sex != null">
                #{comActDpc.sex},
            </if>
            <if test="comActDpc.area != null and comActDpc.area != ''">
                #{comActDpc.area},
            </if>
            <if test="comActDpc.belong != null and comActDpc.belong != ''">
                #{comActDpc.belong},
            </if>
            <if test="comActDpc.category != null and comActDpc.category != ''">
                #{comActDpc.category},
            </if>
            <if test="comActDpc.position != null and comActDpc.position != ''">
                #{comActDpc.position},
            </if>
            <if test="comActDpc.photo != null and comActDpc.photo != ''">
                #{comActDpc.photo},
            </if>
            <if test="comActDpc.communityId != null ">
                #{comActDpc.communityId},
            </if>
            <if test="comActDpc.createdBy != null ">
                #{comActDpc.createdBy},
            </if>
            <if test="comActDpc.createdAt != null ">
                #{comActDpc.createdAt},
            </if>
        </trim>
    </insert>
</mapper>