This commit is contained in:
2025-07-01 17:54:58 +08:00
commit 57dcd609e2
5136 changed files with 346184 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zhwl</groupId>
<artifactId>zhwl-business</artifactId>
<version>3.8.7</version>
</parent>
<artifactId>zhwl-customer</artifactId>
<description>客户管理</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,108 @@
package com.zhwl.customer.controller;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.core.page.TableDataInfo;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.customer.domain.ZdyGuide;
import com.zhwl.customer.domain.vo.ZdyGuideVO;
import com.zhwl.customer.service.IZdyGuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
* 导游管理Controller
*
* @author wangtao
* @date 2024-08-01
*/
@RestController
@RequestMapping("/customer/guide")
public class ZdyGuideController extends BaseController {
@Autowired
private IZdyGuideService zdyGuideService;
/**
* 旅商通接口 查询导游基础信息接口
* @return
*/
@GetMapping("/baseList")
public AjaxResult baseList() {
List<Map<String, Object>> zdyGuides = zdyGuideService.selectBaseList();
return success(zdyGuides);
}
/**
* 查询导游列表
*/
@DataScope(deptAlias = "g")
@PreAuthorize("@ss.hasPermi('customer:guide:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyGuide zdyGuide) {
startPage();
List<ZdyGuideVO> list = zdyGuideService.selectZdyGuidezVOList(zdyGuide);
return getDataTable(list);
}
/**
* 导出导游列表
*/
@DataScope(deptAlias = "g")
@PreAuthorize("@ss.hasPermi('customer:guide:export')")
@Log(title = "导游管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyGuide zdyGuide) {
List<ZdyGuide> list = zdyGuideService.selectZdyGuideList(zdyGuide);
ExcelUtil<ZdyGuide> util = new ExcelUtil<ZdyGuide>(ZdyGuide.class);
util.exportExcel(response, list, "导游管理数据");
}
/**
* 获取导游详细信息
*/
@PreAuthorize("@ss.hasPermi('customer:guide:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyGuideService.selectZdyGuideById(id));
}
/**
* 新增导游
*/
@PreAuthorize("@ss.hasPermi('customer:guide:add')")
@Log(title = "导游管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody @Valid ZdyGuide zdyGuide) {
zdyGuide.setDeptId(SecurityUtils.getDeptId());
return toAjax(zdyGuideService.insertZdyGuide(zdyGuide));
}
/**
* 修改导游
*/
@PreAuthorize("@ss.hasPermi('customer:guide:edit')")
@Log(title = "导游管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody @Valid ZdyGuide zdyGuide) {
return toAjax(zdyGuideService.updateZdyGuide(zdyGuide));
}
/**
* 删除导游
*/
@PreAuthorize("@ss.hasPermi('customer:guide:remove')")
@Log(title = "导游管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyGuideService.deleteZdyGuideByIds(ids));
}
}

View File

@@ -0,0 +1,115 @@
package com.zhwl.customer.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.customer.domain.ZdyGuideNotice;
import com.zhwl.customer.service.IZdyGuideNoticeService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
/**
* 导游公告Controller
*
* @author wangtao
* @date 2024-08-01
*/
@RestController
@RequestMapping("/customer/guide_notice")
public class ZdyGuideNoticeController extends BaseController {
@Autowired
private IZdyGuideNoticeService zdyGuideNoticeService;
/**
* 查询导游公告列表
*/
@DataScope(deptAlias = "gn")
@PreAuthorize("@ss.hasPermi('customer:guide_notice:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyGuideNotice zdyGuideNotice) {
startPage();
List<ZdyGuideNotice> list = zdyGuideNoticeService.selectZdyGuideNoticeList(zdyGuideNotice);
return getDataTable(list);
}
/**
* 导出导游公告列表
*/
@DataScope(deptAlias = "gn")
@PreAuthorize("@ss.hasPermi('customer:guide_notice:export')")
@Log(title = "导游公告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyGuideNotice zdyGuideNotice) {
List<ZdyGuideNotice> list = zdyGuideNoticeService.selectZdyGuideNoticeList(zdyGuideNotice);
ExcelUtil<ZdyGuideNotice> util = new ExcelUtil<ZdyGuideNotice>(ZdyGuideNotice.class);
util.exportExcel(response, list, "导游公告数据");
}
/**
* 获取导游公告详细信息
*/
@PreAuthorize("@ss.hasPermi('customer:guide_notice:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyGuideNoticeService.selectZdyGuideNoticeById(id));
}
/**
* 新增导游公告
*/
@PreAuthorize("@ss.hasPermi('customer:guide_notice:add')")
@Log(title = "导游公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody @Valid ZdyGuideNotice zdyGuideNotice) {
zdyGuideNotice.setDeptId(SecurityUtils.getDeptId());
return toAjax(zdyGuideNoticeService.insertZdyGuideNotice(zdyGuideNotice));
}
/**
* 修改导游公告
*/
@PreAuthorize("@ss.hasPermi('customer:guide_notice:edit')")
@Log(title = "导游公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody @Valid ZdyGuideNotice zdyGuideNotice) {
return toAjax(zdyGuideNoticeService.updateZdyGuideNotice(zdyGuideNotice));
}
/**
* 删除导游公告
*/
@PreAuthorize("@ss.hasPermi('customer:guide_notice:remove')")
@Log(title = "导游公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyGuideNoticeService.deleteZdyGuideNoticeByIds(ids));
}
/**
* 查询导游公告列表 不分页
*/
@DataScope(deptAlias = "gn")
@GetMapping("/list/nopage")
public TableDataInfo listNoPage(ZdyGuideNotice zdyGuideNotice) {
List<ZdyGuideNotice> list = zdyGuideNoticeService.selectZdyGuideNoticeList(zdyGuideNotice);
return getDataTable(list);
}
}

View File

@@ -0,0 +1,239 @@
package com.zhwl.customer.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* 导游对象 zdy_guide
*
* @author wangtao
* @date 2024-08-01
*/
public class ZdyGuide extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 部门id
*/
private Long deptId;
/**
* 导游名称
*/
@NotBlank(message = "导游名称不能为空")
@Excel(name = "导游名称")
@Size(max = 50, message = "导游名称不能大于50个字符")
private String name;
/**
* 标签(多个标签逗号隔开)
*/
@NotBlank(message = "导游标签不能为空")
@Excel(name = "标签", readConverterExp = "多个标签逗号隔开")
@Size(max = 255, message = "导游标签不能大于255个字符")
private String label;
/**
* 性别(0男1女2未知)
*/
@NotNull(message = "性别不能为空")
@Excel(name = "性别")
private Integer gender;
/**
* 手机号码
*/
@NotBlank(message = "手机号码不能为空")
@Excel(name = "手机号码")
private String phone;
/**
* 身份证号码
*/
@NotBlank(message = "身份证号码不能为空")
@Excel(name = "身份证号码")
private String idCard;
/**
* 导游等级0初级1中级2高级3专业导游
*/
@NotNull(message = "导游等级不能为空")
@Excel(name = "导游等级", readConverterExp = "0=初级1中级2高级3专业导游")
private Integer grade;
/**
* 导游证号
*/
@NotBlank(message = "导游证号不能为空")
@Excel(name = "导游证号")
@Size(max = 50, message = "导游证号不能大于50个字符")
private String tourGuideIdNumber;
/**
* 导游照片(多个照片逗号隔开)
*/
@NotBlank(message = "导游照片不能为空")
@Excel(name = "导游照片")
@Size(max = 2000, message = "导游照片选择过多")
private String image;
/**
* 导游简介
*/
@NotBlank(message = "导游简介不能为空")
@Excel(name = "导游简介")
@Size(max = 2000, message = "导游简介不能大于2000个字符")
private String introduction;
/**
* 导游公告id
*/
@NotNull(message = "导游公告不能为空")
@Excel(name = "导游公告")
private Long guideNoticeId;
/**
* 删除标志0否1是
*/
private String delFlag;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setLabel(String label) {
this.label = label;
}
public String getLabel() {
return label;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public Integer getGender() {
return gender;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhone() {
return phone;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public String getIdCard() {
return idCard;
}
public void setGrade(Integer grade) {
this.grade = grade;
}
public Integer getGrade() {
return grade;
}
public void setTourGuideIdNumber(String tourGuideIdNumber) {
this.tourGuideIdNumber = tourGuideIdNumber;
}
public String getTourGuideIdNumber() {
return tourGuideIdNumber;
}
public void setImage(String image) {
this.image = image;
}
public String getImage() {
return image;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getIntroduction() {
return introduction;
}
public void setGuideNoticeId(Long guideNoticeId) {
this.guideNoticeId = guideNoticeId;
}
public Long getGuideNoticeId() {
return guideNoticeId;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public Long getDeptId() {
return deptId;
}
@Override
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("name", getName())
.append("label", getLabel())
.append("gender", getGender())
.append("phone", getPhone())
.append("idCard", getIdCard())
.append("grade", getGrade())
.append("tourGuideIdNumber", getTourGuideIdNumber())
.append("image", getImage())
.append("introduction", getIntroduction())
.append("guideNoticeId", getGuideNoticeId())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -0,0 +1,106 @@
package com.zhwl.customer.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 导游公告对象 zdy_guide_notice
*
* @author wangtao
* @date 2024-08-01
*/
public class ZdyGuideNotice extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 部门id
*/
private Long deptId;
/**
* 公告名称
*/
@NotBlank(message = "公告名称不能为空")
@Excel(name = "公告名称")
@Size(max = 50,message = "公告名称不能大于50个字符")
private String name;
/**
* 公告内容
*/
@NotBlank(message = "公告内容不能为空")
@Excel(name = "公告内容")
private String content;
/**
* 删除标志0否1是
*/
private String delFlag;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
@Override
public Long getDeptId() {
return deptId;
}
@Override
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setContent(String content) {
this.content = content;
}
public String getContent() {
return content;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("name", getName())
.append("content", getContent())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@@ -0,0 +1,158 @@
package com.zhwl.customer.domain.vo;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 导游对象 zdy_guide_vo
*
* @author wangtao
* @date 2024-08-01
*/
public class ZdyGuideVO extends BaseEntity {
private static final long serialVersionUID = 2087793972306629613L;
private Long id;
/**
* 导游名称
*/
private String name;
/**
* 标签(多个标签逗号隔开)
*/
private String label;
/**
* 性别(0男1女2未知)
*/
private Integer gender;
/**
* 手机号码
*/
private String phone;
/**
* 身份证号码
*/
private String idCard;
/**
* 导游等级0初级1中级2高级3专业导游
*/
private Integer grade;
/**
* 导游证号
*/
private String tourGuideIdNumber;
/**
* 导游照片(多个照片逗号隔开)
*/
private String image;
/**
* 导游简介
*/
private String introduction;
/**
* 导游公告内容
*/
private String guideNoticeContent;
/**
* 所属景区名称
*/
private String scenicName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public Integer getGrade() {
return grade;
}
public void setGrade(Integer grade) {
this.grade = grade;
}
public String getTourGuideIdNumber() {
return tourGuideIdNumber;
}
public void setTourGuideIdNumber(String tourGuideIdNumber) {
this.tourGuideIdNumber = tourGuideIdNumber;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getGuideNoticeContent() {
return guideNoticeContent;
}
public void setGuideNoticeContent(String guideNoticeContent) {
this.guideNoticeContent = guideNoticeContent;
}
public String getScenicName() {
return scenicName;
}
public void setScenicName(String scenicName) {
this.scenicName = scenicName;
}
}

View File

@@ -0,0 +1,110 @@
package com.zhwl.customer.mapper;
import com.zhwl.customer.domain.ZdyGuide;
import com.zhwl.customer.domain.vo.ZdyGuideVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 导游管理Mapper接口
*
* @author wangtao
* @date 2024-08-01
*/
public interface ZdyGuideMapper {
/**
* 查询导游
*
* @param id 导游主键
* @return 导游管理
*/
public ZdyGuide selectZdyGuideById(Long id);
/**
* 旅商通接口 查询导游基本信息
* @return
*/
public List<Map<String,Object>> selectBaseList();
/**
* 查询导游列表
*
* @param zdyGuide 导游
* @return 导游管理集合
*/
public List<ZdyGuide> selectZdyGuideList(ZdyGuide zdyGuide);
/**
* 新增导游
*
* @param zdyGuide 导游
* @return 结果
*/
public int insertZdyGuide(ZdyGuide zdyGuide);
/**
* 修改导游
*
* @param zdyGuide 导游
* @return 结果
*/
public int updateZdyGuide(ZdyGuide zdyGuide);
/**
* 删除导游
*
* @param id 导游主键
* @return 结果
*/
public int deleteZdyGuideById(Long id);
/**
* 批量删除导游
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyGuideByIds(Long[] ids);
/**
* 检查手机号是否存在
*
* @param phone
* @return
*/
ZdyGuide checkPhoneUnique(@Param("phone") String phone);
/**
* 检查身份证号是否存在
*
* @param idCard
* @return
*/
ZdyGuide checkIdCardUnique(@Param("idCard") String idCard);
/**
* 检查导游证号是否存在
*
* @param tourGuideIdNumber
* @return
*/
ZdyGuide checkTourGuideIdNumberUnique(@Param("deptId") Long deptId, @Param("tourGuideIdNumber") String tourGuideIdNumber);
/**
* 根据导游公告id查询
*
* @param guideNoticeId 导游公告id
* @return 结果
*/
Integer countByGuideNoticeId(@Param("guideNoticeId") Long guideNoticeId);
/**
* 查询导游列表
*
* @param zdyGuide
* @return
*/
List<ZdyGuideVO> selectZdyGuideVOList(ZdyGuide zdyGuide);
}

View File

@@ -0,0 +1,71 @@
package com.zhwl.customer.mapper;
import java.util.List;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.customer.domain.ZdyGuideNotice;
import org.apache.ibatis.annotations.Param;
/**
* 导游公告Mapper接口
*
* @author wangtao
* @date 2024-08-01
*/
public interface ZdyGuideNoticeMapper {
/**
* 查询导游公告
*
* @param id 导游公告主键
* @return 导游公告
*/
public ZdyGuideNotice selectZdyGuideNoticeById(Long id);
/**
* 查询导游公告列表
*
* @param zdyGuideNotice 导游公告
* @return 导游公告集合
*/
public List<ZdyGuideNotice> selectZdyGuideNoticeList(ZdyGuideNotice zdyGuideNotice);
/**
* 新增导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
public int insertZdyGuideNotice(ZdyGuideNotice zdyGuideNotice);
/**
* 修改导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
public int updateZdyGuideNotice(ZdyGuideNotice zdyGuideNotice);
/**
* 删除导游公告
*
* @param id 导游公告主键
* @return 结果
*/
public int deleteZdyGuideNoticeById(Long id);
/**
* 批量删除导游公告
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyGuideNoticeByIds(Long[] ids);
/**
* 检查公告名称是否存在
*
* @param name
* @return
*/
ZdyGuideNotice checkNameUnique(@Param("deptId") Long deptId, @Param("name") String name);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.customer.service;
import java.util.List;
import com.zhwl.customer.domain .ZdyGuideNotice;
/**
* 导游公告Service接口
*
* @author wangtao
* @date 2024-08-01
*/
public interface IZdyGuideNoticeService {
/**
* 查询导游公告
*
* @param id 导游公告主键
* @return 导游公告
*/
public ZdyGuideNotice selectZdyGuideNoticeById(Long id);
/**
* 查询导游公告列表
*
* @param zdyGuideNotice 导游公告
* @return 导游公告集合
*/
public List<ZdyGuideNotice> selectZdyGuideNoticeList(ZdyGuideNotice zdyGuideNotice);
/**
* 新增导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
public int insertZdyGuideNotice(ZdyGuideNotice zdyGuideNotice);
/**
* 修改导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
public int updateZdyGuideNotice(ZdyGuideNotice zdyGuideNotice);
/**
* 批量删除导游公告
*
* @param ids 需要删除的导游公告主键集合
* @return 结果
*/
public int deleteZdyGuideNoticeByIds(Long[] ids);
/**
* 删除导游公告信息
*
* @param id 导游公告主键
* @return 结果
*/
public int deleteZdyGuideNoticeById(Long id);
}

View File

@@ -0,0 +1,85 @@
package com.zhwl.customer.service;
import com.zhwl.customer.domain.ZdyGuide;
import com.zhwl.customer.domain.vo.ZdyGuideVO;
import java.util.List;
import java.util.Map;
/**
* 导游管理Service接口
*
* @author wangtao
* @date 2024-08-01
*/
public interface IZdyGuideService {
/**
* 查询导游
*
* @param id 导游主键
* @return 导游
*/
public ZdyGuide selectZdyGuideById(Long id);
/**
* 旅商通接口 查询导游基本信息
* @return
*/
public List<Map<String,Object>> selectBaseList();
/**
* 查询导游列表
*
* @param zdyGuide 导游
* @return 导游集合
*/
public List<ZdyGuide> selectZdyGuideList(ZdyGuide zdyGuide);
/**
* 新增导游
*
* @param zdyGuide 导游
* @return 结果
*/
public int insertZdyGuide(ZdyGuide zdyGuide);
/**
* 修改导游
*
* @param zdyGuide 导游
* @return 结果
*/
public int updateZdyGuide(ZdyGuide zdyGuide);
/**
* 批量删除导游
*
* @param ids 需要删除的导游主键集合
* @return 结果
*/
public int deleteZdyGuideByIds(Long[] ids);
/**
* 删除导游信息
*
* @param id 导游主键
* @return 结果
*/
public int deleteZdyGuideById(Long id);
/**
* 根据导游公告id查询
*
* @param guideNoticeId 导游公告id
* @return 结果
*/
public Integer countByGuideNoticeId(Long guideNoticeId);
/**
* 查询导游信息列表
*
* @param zdyGuide
* @return
*/
List<ZdyGuideVO> selectZdyGuidezVOList(ZdyGuide zdyGuide);
}

View File

@@ -0,0 +1,128 @@
package com.zhwl.customer.service.impl;
import java.util.List;
import java.util.Objects;
import com.zhwl.common.constant.Constants;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.StringUtils;
import com.zhwl.customer.service.IZdyGuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhwl.customer.mapper.ZdyGuideNoticeMapper;
import com.zhwl.customer.domain.ZdyGuideNotice;
import com.zhwl.customer.service.IZdyGuideNoticeService;
import org.springframework.transaction.annotation.Transactional;
/**
* 导游公告Service业务层处理
*
* @author wangtao
* @date 2024-08-01
*/
@Service
public class ZdyGuideNoticeServiceImpl implements IZdyGuideNoticeService {
@Autowired
private ZdyGuideNoticeMapper zdyGuideNoticeMapper;
@Autowired
private IZdyGuideService guideService;
/**
* 查询导游公告
*
* @param id 导游公告主键
* @return 导游公告
*/
@Override
public ZdyGuideNotice selectZdyGuideNoticeById(Long id) {
return zdyGuideNoticeMapper.selectZdyGuideNoticeById(id);
}
/**
* 查询导游公告列表
*
* @param zdyGuideNotice 导游公告
* @return 导游公告
*/
@Override
public List<ZdyGuideNotice> selectZdyGuideNoticeList(ZdyGuideNotice zdyGuideNotice) {
return zdyGuideNoticeMapper.selectZdyGuideNoticeList(zdyGuideNotice);
}
/**
* 新增导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
@Override
@Transactional
public int insertZdyGuideNotice(ZdyGuideNotice zdyGuideNotice) {
checkNoticeNameUnique(zdyGuideNotice);
zdyGuideNotice.setCreateTime(DateUtils.getNowDate());
zdyGuideNotice.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
zdyGuideNotice.setDelFlag(Constants.DEL_FLAG_NO);
return zdyGuideNoticeMapper.insertZdyGuideNotice(zdyGuideNotice);
}
/**
* 修改导游公告
*
* @param zdyGuideNotice 导游公告
* @return 结果
*/
@Override
@Transactional
public int updateZdyGuideNotice(ZdyGuideNotice zdyGuideNotice) {
checkNoticeNameUnique(zdyGuideNotice);
zdyGuideNotice.setUpdateTime(DateUtils.getNowDate());
zdyGuideNotice.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
return zdyGuideNoticeMapper.updateZdyGuideNotice(zdyGuideNotice);
}
/**
* 批量删除导游公告
*
* @param ids 需要删除的导游公告主键
* @return 结果
*/
@Override
@Transactional
public int deleteZdyGuideNoticeByIds(Long[] ids) {
for (Long id : ids) {
Integer i = guideService.countByGuideNoticeId(id);
if (i > 0) {
throw new ServiceException("公告已被导游使用,不允许删除");
}
}
return zdyGuideNoticeMapper.deleteZdyGuideNoticeByIds(ids);
}
/**
* 删除导游公告信息
*
* @param id 导游公告主键
* @return 结果
*/
@Override
@Transactional
public int deleteZdyGuideNoticeById(Long id) {
return zdyGuideNoticeMapper.deleteZdyGuideNoticeById(id);
}
private void checkNoticeNameUnique(ZdyGuideNotice zdyGuideNotice) {
String name = zdyGuideNotice.getName();
if (StringUtils.isBlank(name)) {
return;
}
Long id = StringUtils.isNull(zdyGuideNotice.getId()) ? -1L : zdyGuideNotice.getId();
ZdyGuideNotice notice = zdyGuideNoticeMapper.checkNameUnique(zdyGuideNotice.getDeptId(),name);
if (!Objects.isNull(notice) && !notice.getId().equals(id)) {
throw new ServiceException("公告名称已存在");
}
}
}

View File

@@ -0,0 +1,179 @@
package com.zhwl.customer.service.impl;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.StrUtil;
import com.zhwl.common.constant.Constants;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.StringUtils;
import com.zhwl.customer.domain.ZdyGuide;
import com.zhwl.customer.domain.vo.ZdyGuideVO;
import com.zhwl.customer.mapper.ZdyGuideMapper;
import com.zhwl.customer.service.IZdyGuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 导游管理Service业务层处理
*
* @author wangtao
* @date 2024-08-01
*/
@Service
public class ZdyGuideServiceImpl implements IZdyGuideService {
@Autowired
private ZdyGuideMapper zdyGuideMapper;
/**
* 查询导游管理
*
* @param id 导游管理主键
* @return 导游管理
*/
@Override
public ZdyGuide selectZdyGuideById(Long id) {
return zdyGuideMapper.selectZdyGuideById(id);
}
@Override
public List<Map<String, Object>> selectBaseList() {
return zdyGuideMapper.selectBaseList();
}
/**
* 查询导游管理列表
*
* @param zdyGuide 导游管理
* @return 导游管理
*/
@Override
public List<ZdyGuide> selectZdyGuideList(ZdyGuide zdyGuide) {
return zdyGuideMapper.selectZdyGuideList(zdyGuide);
}
/**
* 新增导游管理
*
* @param zdyGuide 导游管理
* @return 结果
*/
@Override
@Transactional
public int insertZdyGuide(ZdyGuide zdyGuide) {
checkArgs(zdyGuide);
zdyGuide.setCreateTime(DateUtils.getNowDate());
zdyGuide.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
zdyGuide.setDelFlag(Constants.DEL_FLAG_NO);
return zdyGuideMapper.insertZdyGuide(zdyGuide);
}
/**
* 修改导游管理
*
* @param zdyGuide 导游管理
* @return 结果
*/
@Override
@Transactional
public int updateZdyGuide(ZdyGuide zdyGuide) {
checkArgs(zdyGuide);
zdyGuide.setUpdateTime(DateUtils.getNowDate());
zdyGuide.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
return zdyGuideMapper.updateZdyGuide(zdyGuide);
}
private void checkArgs(ZdyGuide zdyGuide) {
if (StrUtil.isNotBlank(zdyGuide.getPhone()) && !PhoneUtil.isPhone(zdyGuide.getPhone())) {
throw new ServiceException("手机号输入有误");
}
if (StrUtil.isNotBlank(zdyGuide.getIdCard()) && !IdcardUtil.isValidCard(zdyGuide.getIdCard())) {
throw new ServiceException("身份证输入有误");
}
checkPhoneUnique(zdyGuide);
checkIdCardUnique(zdyGuide);
checkTourGuideIdNumberUnique(zdyGuide);
}
/**
* 批量删除导游管理
*
* @param ids 需要删除的导游管理主键
* @return 结果
*/
@Override
@Transactional
public int deleteZdyGuideByIds(Long[] ids) {
return zdyGuideMapper.deleteZdyGuideByIds(ids);
}
/**
* 删除导游管理信息
*
* @param id 导游管理主键
* @return 结果
*/
@Override
@Transactional
public int deleteZdyGuideById(Long id) {
return zdyGuideMapper.deleteZdyGuideById(id);
}
/**
* 根据导游公告id查询
*
* @param guideNoticeId 导游公告id
* @return 结果
*/
@Override
public Integer countByGuideNoticeId(Long guideNoticeId) {
return zdyGuideMapper.countByGuideNoticeId(guideNoticeId);
}
@Override
public List<ZdyGuideVO> selectZdyGuidezVOList(ZdyGuide zdyGuide) {
return zdyGuideMapper.selectZdyGuideVOList(zdyGuide);
}
private void checkPhoneUnique(ZdyGuide zdyGuide) {
String phone = zdyGuide.getPhone();
if (StringUtils.isBlank(phone)) {
return;
}
Long id = StringUtils.isNull(zdyGuide.getId()) ? -1L : zdyGuide.getId();
ZdyGuide guide = zdyGuideMapper.checkPhoneUnique(phone);
if (!Objects.isNull(guide) && !guide.getId().equals(id)) {
throw new ServiceException("手机号码已存在");
}
}
private void checkIdCardUnique(ZdyGuide zdyGuide) {
String idCard = zdyGuide.getIdCard();
if (StringUtils.isBlank(idCard)) {
return;
}
Long id = StringUtils.isNull(zdyGuide.getId()) ? -1L : zdyGuide.getId();
ZdyGuide guide = zdyGuideMapper.checkIdCardUnique(idCard);
if (!Objects.isNull(guide) && !guide.getId().equals(id)) {
throw new ServiceException("身份证号已存在");
}
}
private void checkTourGuideIdNumberUnique(ZdyGuide zdyGuide) {
String tourGuideIdNumber = zdyGuide.getTourGuideIdNumber();
if (StringUtils.isBlank(tourGuideIdNumber)) {
return;
}
Long id = StringUtils.isNull(zdyGuide.getId()) ? -1L : zdyGuide.getId();
ZdyGuide guide = zdyGuideMapper.checkTourGuideIdNumberUnique(zdyGuide.getDeptId(), tourGuideIdNumber);
if (!Objects.isNull(guide) && !guide.getId().equals(id)) {
throw new ServiceException("导游证号已存在");
}
}
}

View File

@@ -0,0 +1,368 @@
<?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.zhwl.customer.mapper.ZdyGuideMapper">
<resultMap type="ZdyGuide" id="ZdyGuideResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="label" column="label"/>
<result property="gender" column="gender"/>
<result property="phone" column="phone"/>
<result property="idCard" column="id_card"/>
<result property="grade" column="grade"/>
<result property="tourGuideIdNumber" column="tour_guide_id_number"/>
<result property="image" column="image"/>
<result property="introduction" column="introduction"/>
<result property="guideNoticeId" column="guide_notice_id"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<resultMap type="ZdyGuideVO" id="ZdyGuideVOResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="label" column="label"/>
<result property="gender" column="gender"/>
<result property="phone" column="phone"/>
<result property="idCard" column="id_card"/>
<result property="grade" column="grade"/>
<result property="tourGuideIdNumber" column="tour_guide_id_number"/>
<result property="image" column="image"/>
<result property="introduction" column="introduction"/>
<result property="guideNoticeContent" column="guide_notice_content"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="scenicName" column="scenic_name"/>
</resultMap>
<sql id="selectZdyGuideVo">
select id,
name,
label,
gender,
phone,
id_card,
grade,
tour_guide_id_number,
image,
introduction,
guide_notice_id,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from zdy_guide g
</sql>
<select id="selectZdyGuideList" parameterType="ZdyGuide" resultMap="ZdyGuideResult">
<include refid="selectZdyGuideVo"/>
<where>
del_flag = '0'
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="label != null and label != ''">
and label = #{label}
</if>
<if test="gender != null ">
and gender = #{gender}
</if>
<if test="phone != null and phone != ''">
and phone like concat('%', #{phone}, '%')
</if>
<if test="idCard != null and idCard != ''">
and id_card like concat('%', #{idCard}, '%')
</if>
<if test="grade != null ">
and grade = #{grade}
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">
and tour_guide_id_number = #{tourGuideIdNumber}
</if>
<if test="image != null and image != ''">
and image = #{image}
</if>
<if test="introduction != null and introduction != ''">
and introduction = #{introduction}
</if>
<if test="guideNoticeId != null ">
and guide_notice_id = #{guideNoticeId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyGuideById" parameterType="Long"
resultMap="ZdyGuideResult">
<include refid="selectZdyGuideVo"/>
where id = #{id}
and del_flag = '0'
</select>
<insert id="insertZdyGuide" parameterType="ZdyGuide" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_guide
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,
</if>
<if test="deptId != null ">dept_id,
</if>
<if test="label != null and label != ''">label,
</if>
<if test="gender != null">gender,
</if>
<if test="phone != null and phone != ''">phone,
</if>
<if test="idCard != null and idCard != ''">id_card,
</if>
<if test="grade != null">grade,
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">tour_guide_id_number,
</if>
<if test="image != null and image != ''">image,
</if>
<if test="introduction != null and introduction != ''">introduction,
</if>
<if test="guideNoticeId != null">guide_notice_id,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},
</if>
<if test="deptId != null ">#{deptId},
</if>
<if test="label != null and label != ''">#{label},
</if>
<if test="gender != null">#{gender},
</if>
<if test="phone != null and phone != ''">#{phone},
</if>
<if test="idCard != null and idCard != ''">#{idCard},
</if>
<if test="grade != null">#{grade},
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">#{tourGuideIdNumber},
</if>
<if test="image != null and image != ''">#{image},
</if>
<if test="introduction != null and introduction != ''">#{introduction},
</if>
<if test="guideNoticeId != null">#{guideNoticeId},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateZdyGuide" parameterType="ZdyGuide">
update zdy_guide
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name =
#{name},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="label != null and label != ''">label =
#{label},
</if>
<if test="gender != null">gender =
#{gender},
</if>
<if test="phone != null and phone != ''">phone =
#{phone},
</if>
<if test="idCard != null and idCard != ''">id_card =
#{idCard},
</if>
<if test="grade != null">grade =
#{grade},
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">tour_guide_id_number =
#{tourGuideIdNumber},
</if>
<if test="image != null and image != ''">image =
#{image},
</if>
<if test="introduction != null and introduction != ''">introduction =
#{introduction},
</if>
<if test="guideNoticeId != null">guide_notice_id =
#{guideNoticeId},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyGuideById" parameterType="Long">
delete
from zdy_guide
where id = #{id}
</delete>
<delete id="deleteZdyGuideByIds" parameterType="String">
update zdy_guide set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkPhoneUnique" parameterType="string" resultMap="ZdyGuideResult">
select id, phone
from zdy_guide
where phone = #{phone}
and del_flag = '0' limit 1
</select>
<select id="checkIdCardUnique" parameterType="string" resultMap="ZdyGuideResult">
select id, id_card
from zdy_guide
where id_card = #{idCard}
and del_flag = '0' limit 1
</select>
<select id="checkTourGuideIdNumberUnique" resultMap="ZdyGuideResult">
select id, tour_guide_id_number
from zdy_guide
where dept_id = #{deptId}
and tour_guide_id_number = #{tourGuideIdNumber}
and del_flag = '0' limit 1
</select>
<select id="countByGuideNoticeId" resultType="integer">
select count(id)
from zdy_guide
where del_flag = '0'
and guide_notice_id = #{guideNoticeId}
</select>
<select id="selectZdyGuideVOList" parameterType="ZdyGuide" resultMap="ZdyGuideVOResult">
select g.id,
g.name,
g.label,
g.gender,
g.phone,
g.id_card,
g.grade,
g.tour_guide_id_number,
g.image,
g.introduction,
gn.content guide_notice_content,
g.del_flag,
g.create_by,
g.create_time,
g.update_by,
g.update_time,
g.remark,
zs.scenic_name
from zdy_guide g
left join zdy_guide_notice gn on g.guide_notice_id = gn.id
left join zdy_scenic zs on zs.dept_id = g.dept_id
<where>
g.del_flag = '0'
<if test="name != null and name != ''">
and g.name like concat('%', #{name}, '%')
</if>
<if test="label != null and label != ''">
and g.label = #{label}
</if>
<if test="gender != null ">
and g.gender = #{gender}
</if>
<if test="phone != null and phone != ''">
and g.phone like concat('%', #{phone}, '%')
</if>
<if test="idCard != null and idCard != ''">
and g.id_card like concat('%', #{idCard}, '%')
</if>
<if test="grade != null ">
and g.grade = #{grade}
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">
and g.tour_guide_id_number = #{tourGuideIdNumber}
</if>
<if test="image != null and image != ''">
and g.image = #{image}
</if>
<if test="introduction != null and introduction != ''">
and g.introduction = #{introduction}
</if>
<if test="guideNoticeId != null ">
and g.guide_notice_id = #{guideNoticeId}
</if>
<if test="deptId != null ">
and g.dept_id = #{deptId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectBaseList" resultType="java.util.Map">
SELECT
g.id,
g.name,
sex.dict_label AS gender,
g.phone,
g.id_card as idCard,
grade.dict_label AS grade,
g.tour_guide_id_number as tourGuideIdNumber,
g.image,
g.introduction,
g.label
FROM
zdy_guide g
LEFT JOIN sys_dict_data sex ON sex.dict_type = 'sys_user_sex' AND sex.dict_value = g.gender
LEFT JOIN sys_dict_data grade ON grade.dict_type = 'custom_guide_grade' AND grade.dict_value = g.grade
where g.del_flag=0
</select>
</mapper>

View File

@@ -0,0 +1,155 @@
<?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.zhwl.customer.mapper.ZdyGuideNoticeMapper">
<resultMap type="ZdyGuideNotice" id="ZdyGuideNoticeResult">
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="name" column="name"/>
<result property="content" column="content"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectZdyGuideNoticeVo">
select id,
dept_id,
name,
content,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from zdy_guide_notice gn
</sql>
<select id="selectZdyGuideNoticeList" parameterType="ZdyGuideNotice" resultMap="ZdyGuideNoticeResult">
<include refid="selectZdyGuideNoticeVo"/>
<where>
del_flag = '0'
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="content != null and content != ''">
and content = #{content}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyGuideNoticeById" parameterType="Long"
resultMap="ZdyGuideNoticeResult">
<include refid="selectZdyGuideNoticeVo"/>
where id = #{id}
and del_flag = '0'
</select>
<insert id="insertZdyGuideNotice" parameterType="ZdyGuideNotice" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_guide_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,
</if>
<if test="deptId != null">dept_id,
</if>
<if test="content != null and content != ''">content,
</if>
<if test="delFlag != null and delFlag != ''">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},
</if>
<if test="deptId != null">#{deptId},
</if>
<if test="content != null and content != ''">#{content},
</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateZdyGuideNotice" parameterType="ZdyGuideNotice">
update zdy_guide_notice
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name =
#{name},
</if>
<if test="deptId != null ">dept_id =
#{deptId},
</if>
<if test="content != null and content != ''">content =
#{content},
</if>
<if test="delFlag != null and delFlag != ''">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyGuideNoticeById" parameterType="Long">
delete
from zdy_guide_notice
where id = #{id}
</delete>
<delete id="deleteZdyGuideNoticeByIds" parameterType="String">
update zdy_guide_notice set del_flag='1'
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkNameUnique" resultMap="ZdyGuideNoticeResult">
select id, name
from zdy_guide_notice
where dept_id = #{deptId}
and name = #{name}
and del_flag = '0' limit 1
</select>
</mapper>

View File

@@ -0,0 +1,368 @@
<?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.zhwl.customer.mapper.ZdyGuideMapper">
<resultMap type="ZdyGuide" id="ZdyGuideResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="label" column="label"/>
<result property="gender" column="gender"/>
<result property="phone" column="phone"/>
<result property="idCard" column="id_card"/>
<result property="grade" column="grade"/>
<result property="tourGuideIdNumber" column="tour_guide_id_number"/>
<result property="image" column="image"/>
<result property="introduction" column="introduction"/>
<result property="guideNoticeId" column="guide_notice_id"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<resultMap type="ZdyGuideVO" id="ZdyGuideVOResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="label" column="label"/>
<result property="gender" column="gender"/>
<result property="phone" column="phone"/>
<result property="idCard" column="id_card"/>
<result property="grade" column="grade"/>
<result property="tourGuideIdNumber" column="tour_guide_id_number"/>
<result property="image" column="image"/>
<result property="introduction" column="introduction"/>
<result property="guideNoticeContent" column="guide_notice_content"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="scenicName" column="scenic_name"/>
</resultMap>
<sql id="selectZdyGuideVo">
select id,
name,
label,
gender,
phone,
id_card,
grade,
tour_guide_id_number,
image,
introduction,
guide_notice_id,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from zdy_guide g
</sql>
<select id="selectZdyGuideList" parameterType="ZdyGuide" resultMap="ZdyGuideResult">
<include refid="selectZdyGuideVo"/>
<where>
del_flag = '0'
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="label != null and label != ''">
and label = #{label}
</if>
<if test="gender != null ">
and gender = #{gender}
</if>
<if test="phone != null and phone != ''">
and phone like concat('%', #{phone}, '%')
</if>
<if test="idCard != null and idCard != ''">
and id_card like concat('%', #{idCard}, '%')
</if>
<if test="grade != null ">
and grade = #{grade}
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">
and tour_guide_id_number = #{tourGuideIdNumber}
</if>
<if test="image != null and image != ''">
and image = #{image}
</if>
<if test="introduction != null and introduction != ''">
and introduction = #{introduction}
</if>
<if test="guideNoticeId != null ">
and guide_notice_id = #{guideNoticeId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyGuideById" parameterType="Long"
resultMap="ZdyGuideResult">
<include refid="selectZdyGuideVo"/>
where id = #{id}
and del_flag = '0'
</select>
<insert id="insertZdyGuide" parameterType="ZdyGuide" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_guide
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,
</if>
<if test="deptId != null ">dept_id,
</if>
<if test="label != null and label != ''">label,
</if>
<if test="gender != null">gender,
</if>
<if test="phone != null and phone != ''">phone,
</if>
<if test="idCard != null and idCard != ''">id_card,
</if>
<if test="grade != null">grade,
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">tour_guide_id_number,
</if>
<if test="image != null and image != ''">image,
</if>
<if test="introduction != null and introduction != ''">introduction,
</if>
<if test="guideNoticeId != null">guide_notice_id,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},
</if>
<if test="deptId != null ">#{deptId},
</if>
<if test="label != null and label != ''">#{label},
</if>
<if test="gender != null">#{gender},
</if>
<if test="phone != null and phone != ''">#{phone},
</if>
<if test="idCard != null and idCard != ''">#{idCard},
</if>
<if test="grade != null">#{grade},
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">#{tourGuideIdNumber},
</if>
<if test="image != null and image != ''">#{image},
</if>
<if test="introduction != null and introduction != ''">#{introduction},
</if>
<if test="guideNoticeId != null">#{guideNoticeId},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateZdyGuide" parameterType="ZdyGuide">
update zdy_guide
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name =
#{name},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="label != null and label != ''">label =
#{label},
</if>
<if test="gender != null">gender =
#{gender},
</if>
<if test="phone != null and phone != ''">phone =
#{phone},
</if>
<if test="idCard != null and idCard != ''">id_card =
#{idCard},
</if>
<if test="grade != null">grade =
#{grade},
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">tour_guide_id_number =
#{tourGuideIdNumber},
</if>
<if test="image != null and image != ''">image =
#{image},
</if>
<if test="introduction != null and introduction != ''">introduction =
#{introduction},
</if>
<if test="guideNoticeId != null">guide_notice_id =
#{guideNoticeId},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyGuideById" parameterType="Long">
delete
from zdy_guide
where id = #{id}
</delete>
<delete id="deleteZdyGuideByIds" parameterType="String">
update zdy_guide set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkPhoneUnique" parameterType="string" resultMap="ZdyGuideResult">
select id, phone
from zdy_guide
where phone = #{phone}
and del_flag = '0' limit 1
</select>
<select id="checkIdCardUnique" parameterType="string" resultMap="ZdyGuideResult">
select id, id_card
from zdy_guide
where id_card = #{idCard}
and del_flag = '0' limit 1
</select>
<select id="checkTourGuideIdNumberUnique" resultMap="ZdyGuideResult">
select id, tour_guide_id_number
from zdy_guide
where dept_id = #{deptId}
and tour_guide_id_number = #{tourGuideIdNumber}
and del_flag = '0' limit 1
</select>
<select id="countByGuideNoticeId" resultType="integer">
select count(id)
from zdy_guide
where del_flag = '0'
and guide_notice_id = #{guideNoticeId}
</select>
<select id="selectZdyGuideVOList" parameterType="ZdyGuide" resultMap="ZdyGuideVOResult">
select g.id,
g.name,
g.label,
g.gender,
g.phone,
g.id_card,
g.grade,
g.tour_guide_id_number,
g.image,
g.introduction,
gn.content guide_notice_content,
g.del_flag,
g.create_by,
g.create_time,
g.update_by,
g.update_time,
g.remark,
zs.scenic_name
from zdy_guide g
left join zdy_guide_notice gn on g.guide_notice_id = gn.id
left join zdy_scenic zs on zs.dept_id = g.dept_id
<where>
g.del_flag = '0'
<if test="name != null and name != ''">
and g.name like concat('%', #{name}, '%')
</if>
<if test="label != null and label != ''">
and g.label = #{label}
</if>
<if test="gender != null ">
and g.gender = #{gender}
</if>
<if test="phone != null and phone != ''">
and g.phone like concat('%', #{phone}, '%')
</if>
<if test="idCard != null and idCard != ''">
and g.id_card like concat('%', #{idCard}, '%')
</if>
<if test="grade != null ">
and g.grade = #{grade}
</if>
<if test="tourGuideIdNumber != null and tourGuideIdNumber != ''">
and g.tour_guide_id_number = #{tourGuideIdNumber}
</if>
<if test="image != null and image != ''">
and g.image = #{image}
</if>
<if test="introduction != null and introduction != ''">
and g.introduction = #{introduction}
</if>
<if test="guideNoticeId != null ">
and g.guide_notice_id = #{guideNoticeId}
</if>
<if test="deptId != null ">
and g.dept_id = #{deptId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectBaseList" resultType="java.util.Map">
SELECT
g.id,
g.name,
sex.dict_label AS gender,
g.phone,
g.id_card as idCard,
grade.dict_label AS grade,
g.tour_guide_id_number as tourGuideIdNumber,
g.image,
g.introduction,
g.label
FROM
zdy_guide g
LEFT JOIN sys_dict_data sex ON sex.dict_type = 'sys_user_sex' AND sex.dict_value = g.gender
LEFT JOIN sys_dict_data grade ON grade.dict_type = 'custom_guide_grade' AND grade.dict_value = g.grade
where g.del_flag=0
</select>
</mapper>

View File

@@ -0,0 +1,155 @@
<?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.zhwl.customer.mapper.ZdyGuideNoticeMapper">
<resultMap type="ZdyGuideNotice" id="ZdyGuideNoticeResult">
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="name" column="name"/>
<result property="content" column="content"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectZdyGuideNoticeVo">
select id,
dept_id,
name,
content,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from zdy_guide_notice gn
</sql>
<select id="selectZdyGuideNoticeList" parameterType="ZdyGuideNotice" resultMap="ZdyGuideNoticeResult">
<include refid="selectZdyGuideNoticeVo"/>
<where>
del_flag = '0'
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="content != null and content != ''">
and content = #{content}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyGuideNoticeById" parameterType="Long"
resultMap="ZdyGuideNoticeResult">
<include refid="selectZdyGuideNoticeVo"/>
where id = #{id}
and del_flag = '0'
</select>
<insert id="insertZdyGuideNotice" parameterType="ZdyGuideNotice" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_guide_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,
</if>
<if test="deptId != null">dept_id,
</if>
<if test="content != null and content != ''">content,
</if>
<if test="delFlag != null and delFlag != ''">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},
</if>
<if test="deptId != null">#{deptId},
</if>
<if test="content != null and content != ''">#{content},
</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateZdyGuideNotice" parameterType="ZdyGuideNotice">
update zdy_guide_notice
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name =
#{name},
</if>
<if test="deptId != null ">dept_id =
#{deptId},
</if>
<if test="content != null and content != ''">content =
#{content},
</if>
<if test="delFlag != null and delFlag != ''">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyGuideNoticeById" parameterType="Long">
delete
from zdy_guide_notice
where id = #{id}
</delete>
<delete id="deleteZdyGuideNoticeByIds" parameterType="String">
update zdy_guide_notice set del_flag='1'
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkNameUnique" resultMap="ZdyGuideNoticeResult">
select id, name
from zdy_guide_notice
where dept_id = #{deptId}
and name = #{name}
and del_flag = '0' limit 1
</select>
</mapper>