49 changed files with 1360 additions and 72 deletions
@ -0,0 +1,91 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Data |
|||
public class VolunteerTagDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String tagName; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 启用标识 0:否,1:是 |
|||
*/ |
|||
private String enableFlag; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Data |
|||
public class VolunteerTagRelationDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 标签ID |
|||
*/ |
|||
private String tagId; |
|||
|
|||
/** |
|||
* 志愿者ID |
|||
*/ |
|||
private String volunteerId; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.elink.esua.epdc.dto.epdc.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 志愿者标签 |
|||
* |
|||
* @author Liuchuang |
|||
* @since 2021/1/25 15:01 |
|||
*/ |
|||
@Data |
|||
public class VolunteerTagsResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 8355829005926490150L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String tagName; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
} |
@ -0,0 +1,84 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.VolunteerTagDTO; |
|||
import com.elink.esua.epdc.service.VolunteerTagService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("volunteertag") |
|||
public class VolunteerTagController { |
|||
|
|||
@Autowired |
|||
private VolunteerTagService volunteerTagService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<VolunteerTagDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<VolunteerTagDTO> page = volunteerTagService.page(params); |
|||
return new Result<PageData<VolunteerTagDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<VolunteerTagDTO> get(@PathVariable("id") String id){ |
|||
VolunteerTagDTO data = volunteerTagService.get(id); |
|||
return new Result<VolunteerTagDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody VolunteerTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
volunteerTagService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody VolunteerTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
volunteerTagService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
volunteerTagService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.VolunteerTagRelationDTO; |
|||
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("volunteertagrelation") |
|||
public class VolunteerTagRelationController { |
|||
|
|||
@Autowired |
|||
private VolunteerTagRelationService volunteerTagRelationService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<VolunteerTagRelationDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<VolunteerTagRelationDTO> page = volunteerTagRelationService.page(params); |
|||
return new Result<PageData<VolunteerTagRelationDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<VolunteerTagRelationDTO> get(@PathVariable("id") String id){ |
|||
VolunteerTagRelationDTO data = volunteerTagRelationService.get(id); |
|||
return new Result<VolunteerTagRelationDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody VolunteerTagRelationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
volunteerTagRelationService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody VolunteerTagRelationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
volunteerTagRelationService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
volunteerTagRelationService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; |
|||
import com.elink.esua.epdc.entity.VolunteerTagEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Mapper |
|||
public interface VolunteerTagDao extends BaseDao<VolunteerTagEntity> { |
|||
|
|||
/** |
|||
* 志愿者标签 |
|||
* |
|||
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO> |
|||
* @author Liuchuang |
|||
* @since 2021/1/25 15:11 |
|||
*/ |
|||
List<VolunteerTagsResultDTO> selectListOfVolunteerTags(); |
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Mapper |
|||
public interface VolunteerTagRelationDao extends BaseDao<VolunteerTagRelationEntity> { |
|||
|
|||
/** |
|||
* 根据志愿者ID删除志愿者标签 |
|||
* |
|||
* @param volunteerId 志愿者ID |
|||
* @return void |
|||
* @author Liuchuang |
|||
* @since 2021/1/25 15:47 |
|||
*/ |
|||
void updateDelFlagByVolunteerId(String volunteerId); |
|||
} |
@ -0,0 +1,61 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_volunteer_tag") |
|||
public class VolunteerTagEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String tagName; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 启用标识 0:否,1:是 |
|||
*/ |
|||
private String enableFlag; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_volunteer_tag_relation") |
|||
public class VolunteerTagRelationEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标签ID |
|||
*/ |
|||
private String tagId; |
|||
|
|||
/** |
|||
* 志愿者ID |
|||
*/ |
|||
private String volunteerId; |
|||
|
|||
} |
@ -0,0 +1,104 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.VolunteerTagRelationDTO; |
|||
import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
public interface VolunteerTagRelationService extends BaseService<VolunteerTagRelationEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<VolunteerTagRelationDTO> |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
PageData<VolunteerTagRelationDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<VolunteerTagRelationDTO> |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
List<VolunteerTagRelationDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return VolunteerTagRelationDTO |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
VolunteerTagRelationDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void save(VolunteerTagRelationDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void update(VolunteerTagRelationDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 更新志愿者标签 |
|||
* |
|||
* @return boolean |
|||
* @author Liuchuang |
|||
* @since 2021/1/25 15:42 |
|||
*/ |
|||
boolean insertOrUpdateVolunteerTag(VolunteerTagRelationDTO tagDto); |
|||
} |
@ -0,0 +1,105 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.VolunteerTagDTO; |
|||
import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; |
|||
import com.elink.esua.epdc.entity.VolunteerTagEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
public interface VolunteerTagService extends BaseService<VolunteerTagEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<VolunteerTagDTO> |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
PageData<VolunteerTagDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<VolunteerTagDTO> |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
List<VolunteerTagDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return VolunteerTagDTO |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
VolunteerTagDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void save(VolunteerTagDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void update(VolunteerTagDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-01-25 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 志愿者标签 |
|||
* |
|||
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO> |
|||
* @author Liuchuang |
|||
* @since 2021/1/25 15:09 |
|||
*/ |
|||
List<VolunteerTagsResultDTO> listOfVolunteerTags(); |
|||
} |
@ -0,0 +1,111 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.VolunteerTagRelationDao; |
|||
import com.elink.esua.epdc.dto.VolunteerTagRelationDTO; |
|||
import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; |
|||
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 志愿者标签关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Service |
|||
public class VolunteerTagRelationServiceImpl extends BaseServiceImpl<VolunteerTagRelationDao, VolunteerTagRelationEntity> implements VolunteerTagRelationService { |
|||
|
|||
@Override |
|||
public PageData<VolunteerTagRelationDTO> page(Map<String, Object> params) { |
|||
IPage<VolunteerTagRelationEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, VolunteerTagRelationDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<VolunteerTagRelationDTO> list(Map<String, Object> params) { |
|||
List<VolunteerTagRelationEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, VolunteerTagRelationDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<VolunteerTagRelationEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<VolunteerTagRelationEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public VolunteerTagRelationDTO get(String id) { |
|||
VolunteerTagRelationEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, VolunteerTagRelationDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(VolunteerTagRelationDTO dto) { |
|||
VolunteerTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagRelationEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(VolunteerTagRelationDTO dto) { |
|||
VolunteerTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagRelationEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public boolean insertOrUpdateVolunteerTag(VolunteerTagRelationDTO tagDto) { |
|||
// 删除已绑定志愿者标签
|
|||
baseDao.updateDelFlagByVolunteerId(tagDto.getVolunteerId()); |
|||
// 插入新志愿者标签
|
|||
VolunteerTagRelationEntity entity = new VolunteerTagRelationEntity(); |
|||
entity.setVolunteerId(tagDto.getVolunteerId()); |
|||
entity.setTagId(tagDto.getTagId()); |
|||
return insert(entity); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.VolunteerTagDao; |
|||
import com.elink.esua.epdc.dto.VolunteerTagDTO; |
|||
import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; |
|||
import com.elink.esua.epdc.entity.VolunteerTagEntity; |
|||
import com.elink.esua.epdc.service.VolunteerTagService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 志愿者标签表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-01-25 |
|||
*/ |
|||
@Service |
|||
public class VolunteerTagServiceImpl extends BaseServiceImpl<VolunteerTagDao, VolunteerTagEntity> implements VolunteerTagService { |
|||
|
|||
@Override |
|||
public PageData<VolunteerTagDTO> page(Map<String, Object> params) { |
|||
IPage<VolunteerTagEntity> page = baseDao.selectPage( |
|||
getPage(params, "", false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, VolunteerTagDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<VolunteerTagDTO> list(Map<String, Object> params) { |
|||
List<VolunteerTagEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, VolunteerTagDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<VolunteerTagEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<VolunteerTagEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
wrapper.orderByAsc("SORT"); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public VolunteerTagDTO get(String id) { |
|||
VolunteerTagEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, VolunteerTagDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(VolunteerTagDTO dto) { |
|||
VolunteerTagEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(VolunteerTagDTO dto) { |
|||
VolunteerTagEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public List<VolunteerTagsResultDTO> listOfVolunteerTags() { |
|||
return baseDao.selectListOfVolunteerTags(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
<?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.elink.esua.epdc.dao.VolunteerTagDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.VolunteerTagEntity" id="volunteerTagMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="tagName" column="TAG_NAME"/> |
|||
<result property="description" column="DESCRIPTION"/> |
|||
<result property="sort" column="SORT"/> |
|||
<result property="enableFlag" column="ENABLE_FLAG"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="selectListOfVolunteerTags" resultType="com.elink.esua.epdc.entity.VolunteerTagEntity"> |
|||
SELECT ID, TAG_NAME, DESCRIPTION, SORT FROM epdc_volunteer_tag WHERE DEL_FLAG = '0' AND ENABLE_FLAG = '1' ORDER BY SORT |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
<?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.elink.esua.epdc.dao.VolunteerTagRelationDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.VolunteerTagRelationEntity" id="volunteerTagRelationMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="tagId" column="TAG_ID"/> |
|||
<result property="volunteerId" column="VOLUNTEER_ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<update id="updateDelFlagByVolunteerId"> |
|||
UPDATE epdc_volunteer_tag_relation SET DEL_FLAG = '1' WHERE VOLUNTEER_ID = #{volunteerId} |
|||
</update> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue