springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerTypeVO.java
New file @@ -0,0 +1,42 @@ package com.panzhihua.common.model.vos.community; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @Data @ApiModel("志愿者活动类型表") public class VolunteerTypeVO { /** * 主键 */ @ApiModelProperty(value = "主键") private String id; /** * 活动名称 */ @ApiModelProperty(value = "活动名称") private String name; /** * 创建时间 */ @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date creationTime; /** * 更新时间 */ @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; /** * 社区id */ @ApiModelProperty(value = "社区id") private String communityId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -11312,4 +11312,47 @@ R volunteerDeleteById(@RequestParam("id") String id); /******************************************************************************************************************* * * * 志愿者活动类型 * * *******************************************************************************************************************/ /** * 分页查询 * @param * @return */ @GetMapping("/VolunteerType/volunteerTypeGetList") public R volunteerTypeGetList(); /** * 新增 * @param * @return */ @PostMapping("/VolunteerType/insertvolunteerType") public R insertvolunteerType(@RequestBody VolunteerTypeVO volunteerTypeVO); /** * 更新 * @param volunteerTypeVO * @return */ @PostMapping("/VolunteerType/volunteerTypeUpdate") public R volunteerTypeUpdate(@RequestBody VolunteerTypeVO volunteerTypeVO); /** * 删除 * @param id * @return */ @DeleteMapping("/VolunteerType/volunteerTypeDelete") public R volunteerTypeDelete(@RequestParam("id") String id); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerTypeApi.java
New file @@ -0,0 +1,96 @@ package com.panzhihua.community_backstage.api; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @Slf4j @RestController @RequestMapping("/VolunteerType") public class VolunteerTypeApi extends BaseController { @Resource private CommunityService communityService; /** * 分页查询 * @param * @return */ @GetMapping("/volunteerTypeGetList") public R volunteerTypeGetList() { return communityService.volunteerTypeGetList(); } /** * 新增 * @param * @return */ @PostMapping("/insertvolunteerType") public R insertvolunteerType(@RequestBody VolunteerTypeVO volunteerTypeVO) { if(volunteerTypeVO==null) { return R.fail("参数不能为空"); } if(StringUtils.isEmpty(volunteerTypeVO.getName())) { return R.fail("活动类型不能为空"); } if(StringUtils.isEmpty(volunteerTypeVO.getCommunityId())) { volunteerTypeVO.setCommunityId(getLoginUserInfo().getCommunityId()+""); } return communityService.insertvolunteerType(volunteerTypeVO); } /** * 更新 * @param volunteerTypeVO * @return */ @PostMapping("/volunteerTypeUpdate") public R volunteerTypeUpdate(@RequestBody VolunteerTypeVO volunteerTypeVO) { if(volunteerTypeVO==null) { return R.fail("参数不能为空"); } if(StringUtils.isEmpty(volunteerTypeVO.getId())) { return R.fail("id不能为空"); } return communityService.volunteerTypeUpdate(volunteerTypeVO); } /** * 删除 * @param id * @return */ @DeleteMapping("/volunteerTypeDelete") public R volunteerTypeDelete(@RequestParam("id") String id) { if(StringUtils.isEmpty(id)) { return R.fail("id不能为空"); } return communityService.volunteerTypeDelete(id); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerTypeApi.java
New file @@ -0,0 +1,65 @@ package com.panzhihua.service_community.api; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.service_community.service.VolunteerTypeService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @Slf4j @RestController @RequestMapping("/VolunteerType") public class VolunteerTypeApi { @Resource private VolunteerTypeService volunteerTypeService; /** * 分页查询 * @param * @return */ @GetMapping("/volunteerTypeGetList") public R volunteerTypeGetList() { return volunteerTypeService.volunteerTypeGetList(); } /** * 新增 * @param * @return */ @PostMapping("/insertvolunteerType") public R insertvolunteerType(@RequestBody VolunteerTypeVO volunteerTypeVO) { return volunteerTypeService.insertvolunteerType(volunteerTypeVO); } /** * 更新 * @param volunteerTypeVO * @return */ @PostMapping("/volunteerTypeUpdate") public R volunteerTypeUpdate(@RequestBody VolunteerTypeVO volunteerTypeVO) { return volunteerTypeService.volunteerTypeUpdate(volunteerTypeVO); } /** * 删除 * @param id * @return */ @DeleteMapping("/volunteerTypeDelete") public R volunteerTypeDelete(@RequestParam("id") String id) { return volunteerTypeService.volunteerTypeDelete(id); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerTypeDao.java
New file @@ -0,0 +1,40 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.community.VolunteerActivityVO; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.service_community.entity.VolunteerActivity; import com.panzhihua.service_community.entity.VolunteerType; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @Mapper public interface VolunteerTypeDao extends BaseMapper<VolunteerType> { /** * 分页查询 * @param * @return */ List<VolunteerType> volunteerTypeGetList(); /** * 新增 * @param * @return */ int insertvolunteerType(@Param("volunteerTypeVO") VolunteerTypeVO volunteerTypeVO); int volunteerTypeUpdate(@Param("volunteerTypeVO") VolunteerTypeVO volunteerTypeVO); int volunteerTypeDelete(@Param("id") String id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerType.java
New file @@ -0,0 +1,52 @@ 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 VolunteerType implements Serializable { private static final long serialVersionUID = -70884515430727555L; /** * 主键 */ @ApiModelProperty(value = "主键") private String id; /** * 活动名称 */ @ApiModelProperty(value = "活动名称") private String name; /** * 创建时间 */ @ApiModelProperty(value = "创建时间") private Date creationTime; /** * 更新时间 */ @ApiModelProperty(value = "更新时间") private Date updateTime; /** * 社区id */ @ApiModelProperty(value = "社区id") private String communityId; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerTypeService.java
New file @@ -0,0 +1,27 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.service_community.entity.VolunteerType; public interface VolunteerTypeService extends IService<VolunteerType> { /** * 分页查询 * @param * @return */ R volunteerTypeGetList(); /** * 新增 * @param * @return */ R insertvolunteerType(VolunteerTypeVO volunteerTypeVO); R volunteerTypeUpdate(VolunteerTypeVO volunteerTypeVO); R volunteerTypeDelete(String id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerTypeServiceImpl.java
New file @@ -0,0 +1,52 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.service_community.dao.VolunteerTypeDao; import com.panzhihua.service_community.entity.VolunteerType; import com.panzhihua.service_community.service.VolunteerTypeService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @Slf4j @Service public class VolunteerTypeServiceImpl extends ServiceImpl<VolunteerTypeDao, VolunteerType> implements VolunteerTypeService { @Override public R volunteerTypeGetList() { return R.ok(baseMapper.volunteerTypeGetList()); } @Override public R insertvolunteerType(VolunteerTypeVO volunteerTypeVO) { int num= baseMapper.insertvolunteerType(volunteerTypeVO); if(num>0) { return R.ok(); } return R.fail("添加失败"); } @Override public R volunteerTypeUpdate(VolunteerTypeVO volunteerTypeVO) { int num= baseMapper.volunteerTypeUpdate(volunteerTypeVO); if(num>0) { return R.ok(); } return R.fail("添加失败"); } @Override public R volunteerTypeDelete(String id) { int num= baseMapper.volunteerTypeDelete(id); if(num>0) { return R.ok(); } return R.fail("添加失败"); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivityMapper.xml
@@ -191,46 +191,46 @@ #{volunteerActivityVO.acState}, </if> <if test="volunteerActivityVO.awardState != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.awardState}, </if> <if test="volunteerActivityVO.issueTime != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.issueTime}, </if> <if test="volunteerActivityVO.applyBeginTime != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.applyBeginTime}, </if> <if test="volunteerActivityVO.applyEndTime != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.applyEndTime}, </if> <if test="volunteerActivityVO.actityBeginTime != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.actityBeginTime}, </if> <if test="volunteerActivityVO.actityEndTime != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.actityEndTime}, </if> <if test="volunteerActivityVO.communityId != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.communityId}, </if> <if test="volunteerActivityVO.volunteerLimit != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.volunteerLimit}, </if> <if test="volunteerActivityVO.bonusPoints != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.bonusPoints}, </if> <if test="volunteerActivityVO.isCancelled != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.isCancelled}, </if> <if test="volunteerActivityVO.contactName != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.contactName}, </if> <if test="volunteerActivityVO.contactPhone != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.contactPhone}, </if> <if test="volunteerActivityVO.activitCoverUrl != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.activitCoverUrl, </if> <if test="volunteerActivityVO.activityContent != null"> #{volunteerActivityVO.id}, #{volunteerActivityVO.activityContent, </if> sysdate() </trim> @@ -258,46 +258,46 @@ ac_state=#{volunteerActivityVO.acState}, </if> <if test="volunteerActivityVO.awardState != null"> award_state=#{volunteerActivityVO.id}, award_state=#{volunteerActivityVO.awardState}, </if> <if test="volunteerActivityVO.issueTime != null"> issue_time=#{volunteerActivityVO.id}, issue_time=#{volunteerActivityVO.issueTime}, </if> <if test="volunteerActivityVO.applyBeginTime != null"> apply_begin_time=#{volunteerActivityVO.id}, apply_begin_time=#{volunteerActivityVO.applyBeginTime}, </if> <if test="volunteerActivityVO.applyEndTime != null"> apply_end_time=#{volunteerActivityVO.id}, apply_end_time=#{volunteerActivityVO.applyEndTime}, </if> <if test="volunteerActivityVO.actityBeginTime != null"> actity_begin_time=#{volunteerActivityVO.id}, actity_begin_time=#{volunteerActivityVO.actityBeginTime}, </if> <if test="volunteerActivityVO.actityEndTime != null"> actity_end_time=#{volunteerActivityVO.id}, actity_end_time=#{volunteerActivityVO.actityEndTime}, </if> <if test="volunteerActivityVO.communityId != null"> community_id=#{volunteerActivityVO.id}, community_id=#{volunteerActivityVO.communityId}, </if> <if test="volunteerActivityVO.volunteerLimit != null"> volunteer_limit=#{volunteerActivityVO.id}, volunteer_limit=#{volunteerActivityVO.volunteerLimit}, </if> <if test="volunteerActivityVO.bonusPoints != null"> bonus_points=#{volunteerActivityVO.id}, bonus_points=#{volunteerActivityVO.bonusPoints}, </if> <if test="volunteerActivityVO.isCancelled != null"> is_cancelled=#{volunteerActivityVO.id}, is_cancelled=#{volunteerActivityVO.isCancelled}, </if> <if test="volunteerActivityVO.contactName != null"> contact_name=#{volunteerActivityVO.id}, contact_name=#{volunteerActivityVO.contactName}, </if> <if test="volunteerActivityVO.contactPhone != null"> contact_phone=#{volunteerActivityVO.id}, contact_phone=#{volunteerActivityVO.contactPhone}, </if> <if test="volunteerActivityVO.activitCoverUrl != null"> activity_cover_url=#{volunteerActivityVO.id}, activity_cover_url=#{volunteerActivityVO.activitCoverUrl}, </if> <if test="volunteerActivityVO.activityContent != null"> activity_content=#{volunteerActivityVO.id}, activity_content=#{volunteerActivityVO.activityContent}, </if> update_time=sysdate() </set> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerTypeMapper.xml
New file @@ -0,0 +1,74 @@ <?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.VolunteerTypeDao"> <resultMap type="com.panzhihua.service_community.entity.VolunteerType" id="VolunteerTypeMap"> <result property="id" column="id" /> <result property="name" column="name" /> <result property="creationTime" column="creation_time" /> <result property="updateTime" column="update_time" /> <result property="communityId" column="community_id" /> </resultMap> <!-- 分页查询 --> <select id="volunteerTypeGetList" resultMap="VolunteerTypeMap"> select id, name, creation_time, update_time from volunteer_type order by creation_time desc </select> <insert id="insertvolunteerType"> insert into volunteer_type <trim prefix="(" suffix=")" suffixOverrides=","> <if test="volunteerTypeVO.id != null"> id, </if> <if test="volunteerTypeVO.name != null"> name, </if> <if test="volunteerTypeVO.communityId != null"> community_id, </if> creationTime </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="volunteerTypeVO.id != null"> #{volunteerTypeVO.id}, </if> <if test="volunteerTypeVO.name != null"> #{volunteerTypeVO.name}, </if> <if test="volunteerTypeVO.communityId != null"> #{volunteerTypeVO.communityId}, </if> sysdate() </trim> </insert> <update id="volunteerTypeUpdate"> update volunteer_type <set> <if test="volunteerTypeVO.id != null"> id=#{volunteerTypeVO.id}, </if> <if test="volunteerTypeVO.name != null"> name=#{volunteerTypeVO.name}, </if> <if test="volunteerTypeVO.communityId != null"> community_id=#{volunteerTypeVO.communityId}, </if> update_time=sysdate() </set> where id = #{volunteerTypeVO.id} </update> <delete id="volunteerTypeDelete" parameterType="String"> delete from volunteer_type where id=#{id} </delete> </mapper>