小程序端:实名认证功能,入驻修改,master已取消订单查询问题修复

This commit is contained in:
donqi 2022-07-07 15:32:11 +08:00
parent 60778ba082
commit eb49ce9f71
11 changed files with 254 additions and 116 deletions

View File

@ -1,27 +1,34 @@
package com.ghy.worker.controller; package com.ghy.web.controller.worker;
import java.util.List; import com.ghy.common.annotation.Log;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.core.page.TableDataInfo;
import com.ghy.common.enums.BusinessType;
import com.ghy.common.enums.WorkerCertifyStatus;
import com.ghy.common.enums.WorkerStatus;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.system.domain.SysArea;
import com.ghy.system.service.ISysAreaService;
import com.ghy.worker.domain.Worker;
import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.worker.service.WorkerService;
import com.ghy.worker.service.WorkerSpecialSkillService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import java.util.List;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ghy.common.annotation.Log;
import com.ghy.common.enums.BusinessType;
import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.common.core.page.TableDataInfo;
/** /**
* 师傅实名审核Controller * 师傅实名审核Controller
* *
* @author clunt * @author clunt
* @date 2022-07-07 * @date 2022-07-07
*/ */
@ -34,6 +41,15 @@ public class WorkerCertificationController extends BaseController
@Autowired @Autowired
private IWorkerCertificationService workerCertificationService; private IWorkerCertificationService workerCertificationService;
@Autowired
private WorkerSpecialSkillService workerSpecialSkillService;
@Autowired
private ISysAreaService sysAreaService;
@Autowired
private WorkerService workerService;
@RequiresPermissions("worker:certification:view") @RequiresPermissions("worker:certification:view")
@GetMapping() @GetMapping()
public String certification() public String certification()
@ -124,4 +140,47 @@ public class WorkerCertificationController extends BaseController
{ {
return toAjax(workerCertificationService.deleteWorkerCertificationByWorkerCertificationIds(ids)); return toAjax(workerCertificationService.deleteWorkerCertificationByWorkerCertificationIds(ids));
} }
@PostMapping("/app/add")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public AjaxResult appAddCertify(@RequestBody WorkerCertification request) {
try {
// 将师傅状态设置为冻结
Worker worker = new Worker();
worker.setWorkerId(request.getWorkerId());
worker.setStatus(WorkerStatus.DISABLE.getCode());
int updateRows = workerService.updateWorker(worker);
Assert.isTrue(updateRows == 1, "实名认证记录新增失败");
// 删除存在的认证记录
workerCertificationService.deleteCertificationByWorkerId(request.getWorkerId());
// 插入新的认证记录
request.setStatus(WorkerCertifyStatus.AUDITING.getCode());
int insertRows = workerCertificationService.insertWorkerCertification(request);
Assert.isTrue(insertRows == 1, "实名认证记录新增失败");
// 入驻特殊技能信息持久化
workerSpecialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills());
return AjaxResult.success("保存成功");
} catch (Exception e) {
e.printStackTrace();
logger.error(ExceptionUtil.getExceptionMessage(e));
return AjaxResult.error(e.getMessage());
}
}
@PostMapping("/app/getByWorkerId")
@ResponseBody
public AjaxResult getByWorkerId(@RequestBody WorkerCertification request) {
try {
WorkerCertification workerCertification = workerCertificationService.selectByWorkerId(request.getWorkerId());
workerCertification.setSpecialSkills(workerSpecialSkillService.getByWorker(request.getWorkerId()));
SysArea sysArea = sysAreaService.selectById(workerCertification.getCompanyCountryId());
workerCertification.setMergerName(sysArea.getMergerName());
return AjaxResult.success(workerCertification);
} catch (Exception e) {
e.printStackTrace();
logger.error(ExceptionUtil.getExceptionMessage(e));
return AjaxResult.error(e.getMessage());
}
}
} }

View File

@ -207,7 +207,6 @@ public class WorkerController extends BaseController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult settled(@RequestBody WorkerSettledRequest request) { public AjaxResult settled(@RequestBody WorkerSettledRequest request) {
try { try {
// TODO:参数校验
// 入驻区域信息持久化 // 入驻区域信息持久化
workerAreaService.updateWorkerServArea(request.getWorkerId(), request.getWorkerAreas()); workerAreaService.updateWorkerServArea(request.getWorkerId(), request.getWorkerAreas());
// 入驻服务品类信息持久化 // 入驻服务品类信息持久化
@ -226,30 +225,4 @@ public class WorkerController extends BaseController {
return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
} }
} }
@PostMapping("/certify")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public AjaxResult certify(@RequestBody WorkerSettledRequest request) {
try {
// 校验是否已绑定银行信息
WorkerBank workerBank = workerBankService.getByWorkerId(request.getWorkerId());
if (workerBank == null) {
return AjaxResult.error("银行卡未绑定");
}
// 入驻特殊技能信息持久化
specialSkillService.updateWorkerSpecialSkill(request.getWorkerId(), request.getSpecialSkills());
// 更新师傅状态为审核中
Worker worker = new Worker();
worker.setWorkerId(request.getWorkerId());
worker.setStatus(WorkerStatus.AUDITING.getCode());
workerService.updateWorker(worker);
return AjaxResult.success("保存成功");
} catch (Exception e) {
e.printStackTrace();
logger.error(ExceptionUtil.getExceptionMessage(e));
return AjaxResult.error(e.getMessage());
}
}
} }

View File

@ -25,5 +25,5 @@ public class WorkerSettledRequest {
private List<WorkerGoodsCategory> goodsCategories; private List<WorkerGoodsCategory> goodsCategories;
// 特殊技能 // 特殊技能
private List<WorkerSpecialSkill> specialSkills; // private List<WorkerSpecialSkill> specialSkills;
} }

View File

@ -0,0 +1,29 @@
package com.ghy.common.enums;
/**
* 师傅状态
*
* @author ydq
* @date : 2022-06-17 15:32
*/
public enum WorkerCertifyStatus {
AUDITING(0l, "审核中"),
AUDITOK(1l, "审核通过"),
AUDITFAILED(2l, "审核未通过");
private final Long code;
private final String desc;
WorkerCertifyStatus(Long code, String desc) {
this.code = code;
this.desc = desc;
}
public Long getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@ -73,4 +73,6 @@ public class OrderMaster extends BaseEntity {
private Long countryId; private Long countryId;
private Integer exceptOrderStatus;
} }

View File

@ -110,6 +110,9 @@
<if test="countryId != null"> <if test="countryId != null">
AND ca.country_id = #{countryId} AND ca.country_id = #{countryId}
</if> </if>
<if test="exceptOrderStatus != null">
AND om.order_status != #{exceptOrderStatus}
</if>
</where> </where>
order by om.create_time order by om.create_time
<trim suffixOverrides=","> <trim suffixOverrides=",">

View File

@ -5,9 +5,11 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ghy.common.annotation.Excel; import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity; import com.ghy.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 师傅实名审核对象 worker_certification * 师傅实名审核对象 worker_certification
* *
* @author clunt * @author clunt
* @date 2022-07-07 * @date 2022-07-07
*/ */
@ -20,7 +22,7 @@ public class WorkerCertification extends BaseEntity
/** 师傅者id */ /** 师傅者id */
@Excel(name = "师傅者id") @Excel(name = "师傅者id")
private String workerId; private Long workerId;
/** 真实姓名 */ /** 真实姓名 */
@Excel(name = "真实姓名") @Excel(name = "真实姓名")
@ -90,178 +92,200 @@ public class WorkerCertification extends BaseEntity
@Excel(name = "状态0审核中 1审核通过 2审核未通过") @Excel(name = "状态0审核中 1审核通过 2审核未通过")
private Long status; private Long status;
public void setWorkerCertificationId(String workerCertificationId) // 特殊技能
private List<WorkerSpecialSkill> specialSkills;
// provincecitycountry三者的合并名称
private String mergerName;
public void setWorkerCertificationId(String workerCertificationId)
{ {
this.workerCertificationId = workerCertificationId; this.workerCertificationId = workerCertificationId;
} }
public String getWorkerCertificationId() public String getWorkerCertificationId()
{ {
return workerCertificationId; return workerCertificationId;
} }
public void setWorkerId(String workerId) public void setWorkerId(Long workerId)
{ {
this.workerId = workerId; this.workerId = workerId;
} }
public String getWorkerId() public Long getWorkerId()
{ {
return workerId; return workerId;
} }
public void setName(String name) public void setName(String name)
{ {
this.name = name; this.name = name;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public void setIdCardNum(String idCardNum) public void setIdCardNum(String idCardNum)
{ {
this.idCardNum = idCardNum; this.idCardNum = idCardNum;
} }
public String getIdCardNum() public String getIdCardNum()
{ {
return idCardNum; return idCardNum;
} }
public void setIdCardUrl1(String idCardUrl1) public void setIdCardUrl1(String idCardUrl1)
{ {
this.idCardUrl1 = idCardUrl1; this.idCardUrl1 = idCardUrl1;
} }
public String getIdCardUrl1() public String getIdCardUrl1()
{ {
return idCardUrl1; return idCardUrl1;
} }
public void setIdCardUrl2(String idCardUrl2) public void setIdCardUrl2(String idCardUrl2)
{ {
this.idCardUrl2 = idCardUrl2; this.idCardUrl2 = idCardUrl2;
} }
public String getIdCardUrl2() public String getIdCardUrl2()
{ {
return idCardUrl2; return idCardUrl2;
} }
public void setBrandName(String brandName) public void setBrandName(String brandName)
{ {
this.brandName = brandName; this.brandName = brandName;
} }
public String getBrandName() public String getBrandName()
{ {
return brandName; return brandName;
} }
public void setCompanySize(Long companySize) public void setCompanySize(Long companySize)
{ {
this.companySize = companySize; this.companySize = companySize;
} }
public Long getCompanySize() public Long getCompanySize()
{ {
return companySize; return companySize;
} }
public void setCompanyName(String companyName) public void setCompanyName(String companyName)
{ {
this.companyName = companyName; this.companyName = companyName;
} }
public String getCompanyName() public String getCompanyName()
{ {
return companyName; return companyName;
} }
public void setBusinessLicenseNum(String businessLicenseNum) public void setBusinessLicenseNum(String businessLicenseNum)
{ {
this.businessLicenseNum = businessLicenseNum; this.businessLicenseNum = businessLicenseNum;
} }
public String getBusinessLicenseNum() public String getBusinessLicenseNum()
{ {
return businessLicenseNum; return businessLicenseNum;
} }
public void setBusinessLicenseUrl(String businessLicenseUrl) public void setBusinessLicenseUrl(String businessLicenseUrl)
{ {
this.businessLicenseUrl = businessLicenseUrl; this.businessLicenseUrl = businessLicenseUrl;
} }
public String getBusinessLicenseUrl() public String getBusinessLicenseUrl()
{ {
return businessLicenseUrl; return businessLicenseUrl;
} }
public void setCompanyProvinceId(Long companyProvinceId) public void setCompanyProvinceId(Long companyProvinceId)
{ {
this.companyProvinceId = companyProvinceId; this.companyProvinceId = companyProvinceId;
} }
public Long getCompanyProvinceId() public Long getCompanyProvinceId()
{ {
return companyProvinceId; return companyProvinceId;
} }
public void setCompanyCityId(Long companyCityId) public void setCompanyCityId(Long companyCityId)
{ {
this.companyCityId = companyCityId; this.companyCityId = companyCityId;
} }
public Long getCompanyCityId() public Long getCompanyCityId()
{ {
return companyCityId; return companyCityId;
} }
public void setCompanyCountryId(Long companyCountryId) public void setCompanyCountryId(Long companyCountryId)
{ {
this.companyCountryId = companyCountryId; this.companyCountryId = companyCountryId;
} }
public Long getCompanyCountryId() public Long getCompanyCountryId()
{ {
return companyCountryId; return companyCountryId;
} }
public void setCompanyAddress(String companyAddress) public void setCompanyAddress(String companyAddress)
{ {
this.companyAddress = companyAddress; this.companyAddress = companyAddress;
} }
public String getCompanyAddress() public String getCompanyAddress()
{ {
return companyAddress; return companyAddress;
} }
public void setLegalPersionName(String legalPersionName) public void setLegalPersionName(String legalPersionName)
{ {
this.legalPersionName = legalPersionName; this.legalPersionName = legalPersionName;
} }
public String getLegalPersionName() public String getLegalPersionName()
{ {
return legalPersionName; return legalPersionName;
} }
public void setLegalPersionPhoneNum(String legalPersionPhoneNum) public void setLegalPersionPhoneNum(String legalPersionPhoneNum)
{ {
this.legalPersionPhoneNum = legalPersionPhoneNum; this.legalPersionPhoneNum = legalPersionPhoneNum;
} }
public String getLegalPersionPhoneNum() public String getLegalPersionPhoneNum()
{ {
return legalPersionPhoneNum; return legalPersionPhoneNum;
} }
public void setOtherServ(String otherServ) public void setOtherServ(String otherServ)
{ {
this.otherServ = otherServ; this.otherServ = otherServ;
} }
public String getOtherServ() public String getOtherServ()
{ {
return otherServ; return otherServ;
} }
public void setStatus(Long status) public void setStatus(Long status)
{ {
this.status = status; this.status = status;
} }
public Long getStatus() public Long getStatus()
{ {
return status; return status;
} }
public List<WorkerSpecialSkill> getSpecialSkills() {
return specialSkills;
}
public void setSpecialSkills(List<WorkerSpecialSkill> specialSkills) {
this.specialSkills = specialSkills;
}
public String getMergerName() {
return mergerName;
}
public void setMergerName(String mergerName) {
this.mergerName = mergerName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -5,15 +5,15 @@ import com.ghy.worker.domain.WorkerCertification;
/** /**
* 师傅实名审核Mapper接口 * 师傅实名审核Mapper接口
* *
* @author clunt * @author clunt
* @date 2022-07-07 * @date 2022-07-07
*/ */
public interface WorkerCertificationMapper public interface WorkerCertificationMapper
{ {
/** /**
* 查询师傅实名审核 * 查询师傅实名审核
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 师傅实名审核 * @return 师傅实名审核
*/ */
@ -21,7 +21,7 @@ public interface WorkerCertificationMapper
/** /**
* 查询师傅实名审核列表 * 查询师傅实名审核列表
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 师傅实名审核集合 * @return 师傅实名审核集合
*/ */
@ -29,7 +29,7 @@ public interface WorkerCertificationMapper
/** /**
* 新增师傅实名审核 * 新增师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -37,7 +37,7 @@ public interface WorkerCertificationMapper
/** /**
* 修改师傅实名审核 * 修改师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -45,7 +45,7 @@ public interface WorkerCertificationMapper
/** /**
* 删除师傅实名审核 * 删除师傅实名审核
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 结果 * @return 结果
*/ */
@ -53,9 +53,23 @@ public interface WorkerCertificationMapper
/** /**
* 批量删除师傅实名审核 * 批量删除师傅实名审核
* *
* @param workerCertificationIds 需要删除的数据主键集合 * @param workerCertificationIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteWorkerCertificationByWorkerCertificationIds(String[] workerCertificationIds); public int deleteWorkerCertificationByWorkerCertificationIds(String[] workerCertificationIds);
/**
* 用师傅ID查询
*
* @param workerId 师傅ID
*/
WorkerCertification selectByWorkerId(Long workerId);
/**
* 通过师傅id删除实名记录
*
* @param workerId 师傅ID
*/
int deleteCertificationByWorkerId(Long workerId);
} }

View File

@ -5,15 +5,15 @@ import com.ghy.worker.domain.WorkerCertification;
/** /**
* 师傅实名审核Service接口 * 师傅实名审核Service接口
* *
* @author clunt * @author clunt
* @date 2022-07-07 * @date 2022-07-07
*/ */
public interface IWorkerCertificationService public interface IWorkerCertificationService
{ {
/** /**
* 查询师傅实名审核 * 查询师傅实名审核
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 师傅实名审核 * @return 师傅实名审核
*/ */
@ -21,7 +21,7 @@ public interface IWorkerCertificationService
/** /**
* 查询师傅实名审核列表 * 查询师傅实名审核列表
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 师傅实名审核集合 * @return 师傅实名审核集合
*/ */
@ -29,7 +29,7 @@ public interface IWorkerCertificationService
/** /**
* 新增师傅实名审核 * 新增师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -37,7 +37,7 @@ public interface IWorkerCertificationService
/** /**
* 修改师傅实名审核 * 修改师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -45,7 +45,7 @@ public interface IWorkerCertificationService
/** /**
* 批量删除师傅实名审核 * 批量删除师傅实名审核
* *
* @param workerCertificationIds 需要删除的师傅实名审核主键集合 * @param workerCertificationIds 需要删除的师傅实名审核主键集合
* @return 结果 * @return 结果
*/ */
@ -53,9 +53,25 @@ public interface IWorkerCertificationService
/** /**
* 删除师傅实名审核信息 * 删除师傅实名审核信息
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 结果 * @return 结果
*/ */
public int deleteWorkerCertificationByWorkerCertificationId(String workerCertificationId); public int deleteWorkerCertificationByWorkerCertificationId(String workerCertificationId);
/**
* 查询师傅实名审核信息
*
* @param workerId 师傅id
* @return 师傅实名审核信息
*/
WorkerCertification selectByWorkerId(Long workerId);
/**
* 通过师傅id删除师傅实名审核信息
*
* @param workerId 师傅id
* @return 结果
*/
int deleteCertificationByWorkerId(Long workerId);
} }

View File

@ -2,28 +2,29 @@ package com.ghy.worker.service.impl;
import java.util.List; import java.util.List;
import com.ghy.common.utils.DateUtils; import com.ghy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ghy.worker.mapper.WorkerCertificationMapper; import com.ghy.worker.mapper.WorkerCertificationMapper;
import com.ghy.worker.domain.WorkerCertification; import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.common.core.text.Convert; import com.ghy.common.core.text.Convert;
import javax.annotation.Resource;
/** /**
* 师傅实名审核Service业务层处理 * 师傅实名审核Service业务层处理
* *
* @author clunt * @author clunt
* @date 2022-07-07 * @date 2022-07-07
*/ */
@Service @Service
public class WorkerCertificationServiceImpl implements IWorkerCertificationService public class WorkerCertificationServiceImpl implements IWorkerCertificationService
{ {
@Autowired @Resource
private WorkerCertificationMapper workerCertificationMapper; private WorkerCertificationMapper workerCertificationMapper;
/** /**
* 查询师傅实名审核 * 查询师傅实名审核
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 师傅实名审核 * @return 师傅实名审核
*/ */
@ -35,7 +36,7 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
/** /**
* 查询师傅实名审核列表 * 查询师傅实名审核列表
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 师傅实名审核 * @return 师傅实名审核
*/ */
@ -47,7 +48,7 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
/** /**
* 新增师傅实名审核 * 新增师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -60,7 +61,7 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
/** /**
* 修改师傅实名审核 * 修改师傅实名审核
* *
* @param workerCertification 师傅实名审核 * @param workerCertification 师傅实名审核
* @return 结果 * @return 结果
*/ */
@ -73,7 +74,7 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
/** /**
* 批量删除师傅实名审核 * 批量删除师傅实名审核
* *
* @param workerCertificationIds 需要删除的师傅实名审核主键 * @param workerCertificationIds 需要删除的师傅实名审核主键
* @return 结果 * @return 结果
*/ */
@ -85,7 +86,7 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
/** /**
* 删除师傅实名审核信息 * 删除师傅实名审核信息
* *
* @param workerCertificationId 师傅实名审核主键 * @param workerCertificationId 师傅实名审核主键
* @return 结果 * @return 结果
*/ */
@ -94,4 +95,14 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
{ {
return workerCertificationMapper.deleteWorkerCertificationByWorkerCertificationId(workerCertificationId); return workerCertificationMapper.deleteWorkerCertificationByWorkerCertificationId(workerCertificationId);
} }
@Override
public WorkerCertification selectByWorkerId(Long workerId) {
return workerCertificationMapper.selectByWorkerId(workerId);
}
@Override
public int deleteCertificationByWorkerId(Long workerId) {
return workerCertificationMapper.deleteCertificationByWorkerId(workerId);
}
} }

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ghy.worker.mapper.WorkerCertificationMapper"> <mapper namespace="com.ghy.worker.mapper.WorkerCertificationMapper">
<resultMap type="WorkerCertification" id="WorkerCertificationResult"> <resultMap type="WorkerCertification" id="WorkerCertificationResult">
<result property="workerCertificationId" column="worker_certification_id" /> <result property="workerCertificationId" column="worker_certification_id" />
<result property="workerId" column="worker_id" /> <result property="workerId" column="worker_id" />
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWorkerCertificationList" parameterType="WorkerCertification" resultMap="WorkerCertificationResult"> <select id="selectWorkerCertificationList" parameterType="WorkerCertification" resultMap="WorkerCertificationResult">
<include refid="selectWorkerCertificationVo"/> <include refid="selectWorkerCertificationVo"/>
<where> <where>
<if test="workerId != null and workerId != ''"> and worker_id = #{workerId}</if> <if test="workerId != null and workerId != ''"> and worker_id = #{workerId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="idCardNum != null and idCardNum != ''"> and id_card_num = #{idCardNum}</if> <if test="idCardNum != null and idCardNum != ''"> and id_card_num = #{idCardNum}</if>
@ -58,12 +58,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
</where> </where>
</select> </select>
<select id="selectWorkerCertificationByWorkerCertificationId" parameterType="String" resultMap="WorkerCertificationResult"> <select id="selectWorkerCertificationByWorkerCertificationId" parameterType="String" resultMap="WorkerCertificationResult">
<include refid="selectWorkerCertificationVo"/> <include refid="selectWorkerCertificationVo"/>
where worker_certification_id = #{workerCertificationId} where worker_certification_id = #{workerCertificationId}
</select> </select>
<select id="selectByWorkerId" parameterType="Long" resultMap="WorkerCertificationResult">
<include refid="selectWorkerCertificationVo" /> WHERE worker_id = #{workerId}
</select>
<insert id="insertWorkerCertification" parameterType="WorkerCertification" useGeneratedKeys="true" keyProperty="workerCertificationId"> <insert id="insertWorkerCertification" parameterType="WorkerCertification" useGeneratedKeys="true" keyProperty="workerCertificationId">
insert into worker_certification insert into worker_certification
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -153,10 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteWorkerCertificationByWorkerCertificationIds" parameterType="String"> <delete id="deleteWorkerCertificationByWorkerCertificationIds" parameterType="String">
delete from worker_certification where worker_certification_id in delete from worker_certification where worker_certification_id in
<foreach item="workerCertificationId" collection="array" open="(" separator="," close=")"> <foreach item="workerCertificationId" collection="array" open="(" separator="," close=")">
#{workerCertificationId} #{workerCertificationId}
</foreach> </foreach>
</delete> </delete>
</mapper> <delete id="deleteCertificationByWorkerId" parameterType="Long">
DELETE FROM worker_certification WHERE worker_id = #{workerId}
</delete>
</mapper>