lidongdong
2023-08-17 8b529505fac7cba3281ce59e22d4a29b6f07372a
新增志愿者活动表
2个文件已添加
313 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivity.java 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivityMapper.xml 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivity.java
New file
@@ -0,0 +1,135 @@
package com.panzhihua.service_community.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("路北社区志愿者活动表")
public class VolunteerActivity  implements Serializable {
    private static final long serialVersionUID = -70884515430727555L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 活动名称
     */
    @ApiModelProperty(value = "活动名称")
    private String name;
    /**
     * 活动状态
     */
    @ApiModelProperty(value = "活动状态")
    private String acType;
    /**
     * 活动地址
     */
    @ApiModelProperty(value = "活动地址")
    private String address;
    /**
     * 志愿者人数
     */
    @ApiModelProperty(value = "志愿者人数")
    private String volunteerNum;
    /**
     * 活动状态
     */
    @ApiModelProperty(value = "活动状态")
    private String acState;
    /**
     * 奖励发放状态
     */
    @ApiModelProperty(value = "奖励发放状态")
    private String awardState;
    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间")
    private String issueTime;
    /**
     * 报名开始时间
     */
    @ApiModelProperty(value = "报名开始时间")
    private String applyBeginTime;
    /**
     * 报名结束时间
     */
    @ApiModelProperty(value = "报名结束时间")
    private String applyEndTime;
    /**
     * 活动开始时间
     */
    @ApiModelProperty(value = "活动开始时间")
    private String actityBeginTime;
    /**
     * 活动结束时间
     */
    @ApiModelProperty(value = "活动结束时间")
    private String actityEndTime;
    /**
     * 志愿者上限(0无限     大于0 就是限制)
     */
    @ApiModelProperty(value = "志愿者上限(0无限     大于0 就是限制)")
    private String volunteerLimit;
    /**
     * 奖励积分
     */
    @ApiModelProperty(value = "奖励积分")
    private String bonusPoints;
    /**
     * 是否可以报名后取消(0 不可以   1可以)
     */
    @ApiModelProperty(value = "是否可以报名后取消(0 不可以   1可以)")
    private String isCancelled;
    /**
     * 联系人姓名
     */
    @ApiModelProperty(value = "联系人姓名")
    private String contactName;
    /**
     * 联系人电话
     */
    @ApiModelProperty(value = "联系人电话")
    private String contactPhone;
    /**
     * 活动封面
     */
    @ApiModelProperty(value = "活动封面")
    private String activitCoverUrl;
    /**
     * 活动内容
     */
    @ApiModelProperty(value = "活动内容")
    private String activityContent;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date creationTime;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private String communityId;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivityMapper.xml
New file
@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.service_community.dao.MostBeautifulVolunteerDao">
    <resultMap type="com.panzhihua.service_community.entity.VolunteerActivity" id="VolunteerActivityMap">
        <result property="id" column="id" />
        <result property="name" column="name" />
        <result property="acType" column="ac_type" />
        <result property="address" column="address" />
        <result property="volunteerNum" column="volunteer_num" />
        <result property="acState" column="ac_state" />
        <result property="awardState" column="award_state" />
        <result property="issueTime" column="issue_time" />
        <result property="applyBeginTime" column="apply_begin_time" />
        <result property="applyEndTime" column="apply_end_time" />
        <result property="actityBeginTime" column="actity_begin_time" />
        <result property="actityEndTime" column="actity_end_time" />
        <result property="communityId" column="community_id" />
        <result property="volunteerLimit" column="volunteer_limit" />
        <result property="bonusPoints" column="bonus_points" />
        <result property="isCancelled" column="is_cancelled" />
        <result property="contactName" column="contact_name" />
        <result property="contactPhone" column="contact_phone" />
        <result property="activitCoverUrl" column="activity_cover_url" />
        <result property="activityContent" column="activity_content" />
        <result property="creationTime" column="creation_time" />
    </resultMap>
    <!--查询单个-->
    <select id="queryById" resultMap="MostBeautifulVolunteerMap">
        select
            id,
            name,
            ac_type,
            address,
            volunteer_num,
            ac_state,
            award_state,
            issue_time,
            apply_begin_time,
            apply_end_time,
            actity_begin_time,
            actity_end_time,
            community_id,
            volunteer_limit,
            bonus_points,
            is_cancelled,
            contact_name,
            contact_phone,
            activity_cover_url,
            activity_content,
            creation_time
        from volunteer_activity
        where id= #{id}
    </select>
    <!--查询单个-->
    <select id="queryList" resultMap="MostBeautifulVolunteerMap">
        select
        id,
        name,
        certificate_url,
        self_introduction,
        volunteer_style,
        weight_sorting,
        unmount_type,
        creation_time,
        community_id
        from most_beautiful_volunteer
        <where>
            1=1
            <if test="name!=null and name !=''">
                and (`name` like concat('%',#{name},'%')
            </if>
            <if  test="unmountType!=null and unmountType !=''">
                and unmount_type =# {unmountType}
            </if>
        </where>
        order by weight_sorting asc,creation_time desc
    </select>
    <insert id="insertMostBeautifulVolunteer">
        insert into most_beautiful_volunteer
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="mostBeautifulVolunteerVO.id != null">
                id,
            </if>
            <if test="mostBeautifulVolunteerVO.name != null">
                name,
            </if>
            <if test="mostBeautifulVolunteerVO.certificateUrl != null">
                certificate_url,
            </if>
            <if test="mostBeautifulVolunteerVO.selfIntroduction != null">
                self_introduction,
            </if>
            <if test="mostBeautifulVolunteerVO.volunteerStyle != null">
                volunteer_style,
            </if>
            <if test="mostBeautifulVolunteerVO.weightSorting != null">
                weight_sorting,
            </if>
            <if test="mostBeautifulVolunteerVO.unmountType != null">
                unmount_type,
            </if>
            <if test="mostBeautifulVolunteerVO.communityId != null">
                community_id,
            </if>
            creationTime
        </trim>
        values
        <trim prefix="("  suffix=")" suffixOverrides=",">
            <if test="mostBeautifulVolunteerVO.id != null">
                #{mostBeautifulVolunteerVO.id},
            </if>
            <if test="mostBeautifulVolunteerVO.name != null">
                #{mostBeautifulVolunteerVO.name},
            </if>
            <if test="mostBeautifulVolunteerVO.certificateUrl != null">
                #{mostBeautifulVolunteerVO.certificateUrl},
            </if>
            <if test="mostBeautifulVolunteerVO.selfIntroduction != null">
                #{mostBeautifulVolunteerVO.selfIntroduction},
            </if>
            <if test="mostBeautifulVolunteerVO.volunteerStyle != null">
                #{mostBeautifulVolunteerVO.weightSorting},
            </if>
            <if test="mostBeautifulVolunteerVO.weightSorting != null">
                #{mostBeautifulVolunteerVO.weightSorting},
            </if>
            <if test="mostBeautifulVolunteerVO.unmountType != null">
                #{mostBeautifulVolunteerVO.unmountType},
            </if>
            <if test="mostBeautifulVolunteerVO.communityId != null">
                #{mostBeautifulVolunteerVO.communityId},
            </if>
            sysdate()
        </trim>
    </insert>
    <update id="updateById">
        update most_beautiful_volunteer
        <set>
            <if test="mostBeautifulVolunteerVO.id != null">
                #{mostBeautifulVolunteerVO.id},
            </if>
            <if test="mostBeautifulVolunteerVO.name != null">
                #{mostBeautifulVolunteerVO.name},
            </if>
            <if test="mostBeautifulVolunteerVO.certificateUrl != null">
                #{mostBeautifulVolunteerVO.certificateUrl},
            </if>
            <if test="mostBeautifulVolunteerVO.selfIntroduction != null">
                #{mostBeautifulVolunteerVO.selfIntroduction},
            </if>
            <if test="mostBeautifulVolunteerVO.volunteerStyle != null">
                #{mostBeautifulVolunteerVO.weightSorting},
            </if>
            <if test="mostBeautifulVolunteerVO.weightSorting != null">
                #{mostBeautifulVolunteerVO.weightSorting},
            </if>
            <if test="mostBeautifulVolunteerVO.unmountType != null">
                #{mostBeautifulVolunteerVO.unmountType},
            </if>
            update_time=sysdate()
        </set>
        where id = #{mostBeautifulVolunteerVO.id}
    </update>
    <delete id="deleteById" parameterType="String">
        delete from most_beautiful_volunteer where id=#{id}
    </delete>
</mapper>