| | |
| | | } |
| | | |
| | | |
| | | /**************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇慈善公益 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "金汇慈善公益列表",response = JinhuiCharityVO.class) |
| | | @GetMapping("/getCharityList") |
| | | public R getCharityList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "title", required = false) String title, |
| | | @RequestParam(value = "label", required = false) String label, |
| | | @RequestParam(value = "state", required = false) String state) |
| | | { |
| | | return jinhuiCommunityService.getCharityList(pageNum,pageSize,title,label,state); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.jinhui; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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 JinhuiCharityVO implements Serializable { |
| | | private static final long serialVersionUID = -70884515430727555L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "封面") |
| | | private String coverImgUrl; |
| | | |
| | | @ApiModelProperty(value = "简语") |
| | | private String simpleStatement; |
| | | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "二维码") |
| | | private String qrCodeUrl; |
| | | |
| | | @ApiModelProperty(value = "状态(1 进心中 2已结束)") |
| | | private String state; |
| | | |
| | | @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; |
| | | } |
| | |
| | | public R expurgatePeopleData(@RequestParam("id") String id); |
| | | |
| | | |
| | | /**************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇慈善公益 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/JinhuiCharity/getCharityList") |
| | | public R getCharityList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "title", required = false) String title, |
| | | @RequestParam(value = "label", required = false) String label, |
| | | @RequestParam(value = "state", required = false) String state); |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/JinhuiCharity/getCharityDetails") |
| | | public R getCharityDetails(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/JinhuiCharity/addCharityData") |
| | | public R addCharityData(@RequestBody JinhuiCharityVO item); |
| | | |
| | | @PostMapping("/JinhuiCharity/editCharityData") |
| | | public R editCharityData(@RequestBody JinhuiCharityVO item); |
| | | |
| | | @DeleteMapping("/JinhuiCharity/expurgateCharityData") |
| | | public R expurgateCharityData(@RequestParam("id") String id); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /**************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇慈善公益 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "金汇慈善公益列表",response = JinhuiCharityVO.class) |
| | | @GetMapping("/getCharityList") |
| | | public R getCharityList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "title", required = false) String title, |
| | | @RequestParam(value = "label", required = false) String label, |
| | | @RequestParam(value = "state", required = false) String state) |
| | | { |
| | | return jinhuiCommunityService.getCharityList(pageNum,pageSize,title,label,state); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "金汇慈善公益详情",response = JinhuiCharityVO.class) |
| | | @GetMapping("/getCharityDetails") |
| | | public R getCharityDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.getCharityDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "金汇慈善公益添加") |
| | | @PostMapping("/addCharityData") |
| | | public R addCharityData(@RequestBody JinhuiCharityVO item) |
| | | { |
| | | return jinhuiCommunityService.addCharityData(item); |
| | | } |
| | | |
| | | @ApiOperation(value = "金汇慈善公益编辑") |
| | | @PostMapping("/editCharityData") |
| | | public R editCharityData(@RequestBody JinhuiCharityVO item) |
| | | { |
| | | return jinhuiCommunityService.editCharityData(item); |
| | | } |
| | | |
| | | @ApiOperation(value = "金汇慈善公益删除") |
| | | @DeleteMapping("/expurgateCharityData") |
| | | public R expurgateCharityData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.expurgateCharityData(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCharityVO; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiCharityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 金汇慈善公益 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/JinhuiCharity") |
| | | public class JinhuiCharityApi extends BaseController { |
| | | @Resource |
| | | private JinhuiCharityService charityService; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCharityList") |
| | | public R getCharityList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "title", required = false) String title, |
| | | @RequestParam(value = "label", required = false) String label, |
| | | @RequestParam(value = "state", required = false) String state) |
| | | { |
| | | return charityService.getList(pageNum,pageSize,title,label,state); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCharityDetails") |
| | | public R getCharityDetails(@RequestParam("id") String id) |
| | | { |
| | | return R.ok(charityService.getDetails(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/addCharityData") |
| | | public R addCharityData(@RequestBody JinhuiCharityVO item) |
| | | { |
| | | return charityService.addData(item); |
| | | } |
| | | |
| | | @PostMapping("/editCharityData") |
| | | public R editCharityData(@RequestBody JinhuiCharityVO item) |
| | | { |
| | | return charityService.editData(item); |
| | | } |
| | | |
| | | @DeleteMapping("/expurgateCharityData") |
| | | public R expurgateCharityData(@RequestParam("id") String id) |
| | | { |
| | | return charityService.expurgateData(id); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_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.jinhui.JinhuiCharityVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiCharity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface JinhuiCharityDao extends BaseMapper<JinhuiCharity> |
| | | { |
| | | /** |
| | | * 列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | IPage<JinhuiCharity> getList(Page page, |
| | | @Param("title") String title, |
| | | @Param("label") String label, |
| | | @Param("state") String state); |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | JinhuiCharity getDetails(@Param("id") String id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | int addData(@Param("item") JinhuiCharityVO item); |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | int editData(@Param("item") JinhuiCharityVO item); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int expurgateData(@Param("id") String id); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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 JinhuiCharity implements Serializable { |
| | | private static final long serialVersionUID = -70884515430727555L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "封面") |
| | | private String coverImgUrl; |
| | | |
| | | @ApiModelProperty(value = "简语") |
| | | private String simpleStatement; |
| | | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "二维码") |
| | | private String qrCodeUrl; |
| | | |
| | | @ApiModelProperty(value = "状态(1 进心中 2已结束)") |
| | | private String state; |
| | | |
| | | @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; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCharityVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiCharity; |
| | | |
| | | public interface JinhuiCharityService extends IService<JinhuiCharity> |
| | | { |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | R getList(int pageNum,int pageSize,String title,String label,String state); |
| | | |
| | | JinhuiCharity getDetails(String id); |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | R addData(JinhuiCharityVO item); |
| | | |
| | | R editData(JinhuiCharityVO item); |
| | | |
| | | R expurgateData(String id); |
| | | } |
| | |
| | | */ |
| | | R getList(int pageNum,int pageSize); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | JinhuiSnapshot getDetails(String id); |
| | | /** |
| | | * 新增 |
| | |
| | | */ |
| | | R addData(JinhuiSnapshotVO item); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | R editData(JinhuiSnapshotVO item); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R expurgateData(String id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_jinhui_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCharityVO; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiCharityDao; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiCharity; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiCharityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class JinhuiCharityServiceImpl extends ServiceImpl<JinhuiCharityDao, |
| | | JinhuiCharity> implements JinhuiCharityService |
| | | { |
| | | |
| | | @Override |
| | | public R getList(int pageNum,int pageSize,String title,String label,String state) |
| | | { |
| | | Page page = new Page<JinhuiCharity>(pageNum,pageSize); |
| | | return R.ok(baseMapper.getList(page, title, label, state)); |
| | | } |
| | | |
| | | @Override |
| | | public JinhuiCharity getDetails(String id) { |
| | | return baseMapper.getDetails(id); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R addData(JinhuiCharityVO item) |
| | | { |
| | | int num= baseMapper.addData(item); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R editData(JinhuiCharityVO item) { |
| | | int num= baseMapper.editData(item); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R expurgateData(String id) { |
| | | int num= baseMapper.expurgateData(id); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | } |
New file |
| | |
| | | <?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_jinhui_community.dao.JinhuiCharityDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_jinhui_community.entity.JinhuiCharity" id="itemMap"> |
| | | <result property="id" column="id" /> |
| | | <result property="title" column="title" /> |
| | | <result property="coverImgUrl" column="cover_img_url" /> |
| | | <result property="simpleStatement" column="simple_statement" /> |
| | | <result property="label" column="label" /> |
| | | <result property="content" column="content" /> |
| | | <result property="qrCodeUrl" column="qr_code_url" /> |
| | | <result property="state" column="state" /> |
| | | <result property="creationTime" column="creation_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="getList" resultMap="itemMap"> |
| | | select |
| | | id, |
| | | title, |
| | | cover_img_url, |
| | | simple_statement, |
| | | label, |
| | | content, |
| | | qr_code_url, |
| | | state, |
| | | creation_time, |
| | | update_time |
| | | from jinhui_charity |
| | | <where> |
| | | 1=1 |
| | | <if test="title!=null and title !='' "> |
| | | and title=#{title} |
| | | </if> |
| | | <if test="label!=null and label !='' "> |
| | | and label=#{label} |
| | | </if> |
| | | <if test="state!=null and state !='' "> |
| | | and `state`=#{state} |
| | | </if> |
| | | </where> |
| | | order by creation_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="getDetails" resultMap="itemMap"> |
| | | select |
| | | id, |
| | | title, |
| | | cover_img_url, |
| | | simple_statement, |
| | | label, |
| | | content, |
| | | qr_code_url, |
| | | state, |
| | | creation_time, |
| | | update_time |
| | | from jinhui_charity |
| | | where |
| | | id=#{id} |
| | | </select> |
| | | |
| | | <insert id="addData"> |
| | | insert into jinhui_charity |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="item.id != null and item.id != '' "> |
| | | id, |
| | | </if> |
| | | <if test="item.title != null and item.title != '' "> |
| | | title, |
| | | </if> |
| | | <if test="item.coverImgUrl != null and item.coverImgUrl != '' "> |
| | | cover_img_url, |
| | | </if> |
| | | <if test="item.simpleStatement != null and item.simpleStatement != '' "> |
| | | simple_statement, |
| | | </if> |
| | | <if test="item.label != null and item.label != '' "> |
| | | label, |
| | | </if> |
| | | <if test="item.content != null and item.content != '' "> |
| | | content, |
| | | </if> |
| | | <if test="item.qrCodeUrl != null and item.qrCodeUrl != '' "> |
| | | qr_code_url, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | `state`, |
| | | </if> |
| | | creation_time |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="item.id != null and item.id != '' "> |
| | | #{item.id}, |
| | | </if> |
| | | <if test="item.title != null and item.title != '' "> |
| | | #{item.title}, |
| | | </if> |
| | | <if test="item.coverImgUrl != null and item.coverImgUrl != '' "> |
| | | #{item.coverImgUrl}, |
| | | </if> |
| | | <if test="item.simpleStatement != null and item.simpleStatement != '' "> |
| | | #{item.simpleStatement}, |
| | | </if> |
| | | <if test="item.label != null and item.label != '' "> |
| | | #{item.label}, |
| | | </if> |
| | | <if test="item.content != null and item.content != '' "> |
| | | #{item.content}, |
| | | </if> |
| | | <if test="item.qrCodeUrl != null and item.qrCodeUrl != '' "> |
| | | #{item.qrCodeUrl}, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | #{item.state}, |
| | | </if> |
| | | sysdate() |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="editData"> |
| | | update jinhui_charity |
| | | <set> |
| | | <if test="jinhui_snapshot_classify.id != null and item.id != '' "> |
| | | id=#{item.id}, |
| | | </if> |
| | | <if test="item.title != null and item.title != '' "> |
| | | title=#{item.title}, |
| | | </if> |
| | | <if test="item.coverImgUrl != null and item.coverImgUrl != '' "> |
| | | cover_img_url=#{item.coverImgUrl}, |
| | | </if> |
| | | <if test="item.simpleStatement != null and item.simpleStatement != '' "> |
| | | simple_statement=#{item.simpleStatement}, |
| | | </if> |
| | | <if test="item.label != null and item.label != '' "> |
| | | label=#{item.label}, |
| | | </if> |
| | | <if test="item.content != null and item.content != '' "> |
| | | content=#{item.content}, |
| | | </if> |
| | | <if test="item.qrCodeUrl != null and item.qrCodeUrl != '' "> |
| | | qr_code_url=#{item.qrCodeUrl}, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | `state`=#{item.state}, |
| | | </if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id = #{item.id} |
| | | </update> |
| | | |
| | | <delete id="expurgateData" parameterType="String"> |
| | | delete from jinhui_charity where id=#{id} |
| | | </delete> |
| | | |
| | | </mapper> |