分包基础信息管理,分包出入场(合同)
This commit is contained in:
parent
bdde29802e
commit
ac378d73f4
|
|
@ -164,4 +164,15 @@ public class Constants
|
|||
* 分包商信息表
|
||||
*/
|
||||
public static final String PM_SUB = "pm_sub";
|
||||
|
||||
|
||||
/**
|
||||
* 分包商合同信息
|
||||
*/
|
||||
public static final String BM_SUB_CONTRACT = "bm_sub_contract";
|
||||
|
||||
/**
|
||||
* 分包班组入场信息
|
||||
*/
|
||||
public static final String PM_SUB_TEAM_CONTRACT = "pm_sub_team_contract";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.service.BmSubContractService;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
|
|
@ -11,11 +16,12 @@ import com.bonus.common.security.annotation.InnerAuth;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -47,4 +53,63 @@ public class BmSubContractController extends BaseController {
|
|||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增和修改分包商合同信息
|
||||
*/
|
||||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubContract")
|
||||
@SysLog(title = "分包商合同信息", businessType = OperaType.UPDATE, logType = 0, module = "分包商合同信息->新增和修改分包商合同信息")
|
||||
public AjaxResult addOrUpdateSubContract(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
BmSubContract bmSubContract = FastJsonHelper.jsonStrToBean(params, BmSubContract.class);
|
||||
int res = bmSubContractService.addOrUpdateSubContract(bmSubContract,new FileBasicMsgDto(listFile, files));
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("分包商合同信息已存在");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分包商合同信息
|
||||
*/
|
||||
/*@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:del"))*/
|
||||
@PostMapping("/delSubContract")
|
||||
@SysLog(title = "分包商合同信息", businessType = OperaType.UPDATE, logType = 0, module = "分包商合同信息->删除分包商合同信息")
|
||||
public AjaxResult delSubContract(@Validated @RequestBody BmSubContract bmSubContract) {
|
||||
try {
|
||||
int res = bmSubContractService.delSubContract(bmSubContract);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("公司下面存在未删除的分公司");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分包商合同信息
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "包商合同信息", businessType = OperaType.EXPORT, logType = 0, module = "包商合同信息->导出包商合同信息")
|
||||
public void export(HttpServletResponse response, BmSubContract bmSubContract) {
|
||||
try {
|
||||
List<BmSubContractVo> list = bmSubContractService.selectSubContractList(bmSubContract);
|
||||
ExcelUtil<BmSubContractVo> util = new ExcelUtil<BmSubContractVo>(BmSubContractVo.class);
|
||||
util.exportExcel(response, list, "包商出入场");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class PmSubController extends BaseController {
|
|||
* 新增和修改分包商
|
||||
*/
|
||||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubCompany")
|
||||
@PostMapping("/addOrUpdateSub")
|
||||
@SysLog(title = "分包商管理", businessType = OperaType.UPDATE, logType = 0, module = "分包商管理->新增和修改分包商")
|
||||
public AjaxResult addOrUpdateSub(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
|
|
@ -81,7 +81,7 @@ public class PmSubController extends BaseController {
|
|||
/*@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:del"))*/
|
||||
@PostMapping("/delSub")
|
||||
@SysLog(title = "分包商管理", businessType = OperaType.UPDATE, logType = 0, module = "分包商管理->删除分包商")
|
||||
public AjaxResult delSubCompany(@Validated @RequestBody PmSub pmSub) {
|
||||
public AjaxResult delSub(@Validated @RequestBody PmSub pmSub) {
|
||||
try {
|
||||
int res = pmSubService.delSub(pmSub);
|
||||
if (res>0){
|
||||
|
|
@ -96,6 +96,22 @@ public class PmSubController extends BaseController {
|
|||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分包商列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:sub:list"))
|
||||
@GetMapping("/listAll")
|
||||
@SysLog(title = "分包商管理", businessType = OperaType.QUERY, logType = 0, module = "分包商管理->分包商列表")
|
||||
public TableDataInfo listAll(PmSub pmSub) {
|
||||
try {
|
||||
List<PmSub> list = pmSubService.selectSubList(pmSub);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分包商
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.service.PmSubTeamContractService;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/subTeamContract")
|
||||
public class PmSubTeamContractController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private PmSubTeamContractService pmSubTeamContractService;
|
||||
|
||||
/**
|
||||
* 分包班组信息入场信息列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:teamContract:list"))
|
||||
@GetMapping("/list")
|
||||
@SysLog(title = "分包班组入场信息管理", businessType = OperaType.QUERY, logType = 0, module = "分包班组入场信息管理->分包班组入场信息列表")
|
||||
public TableDataInfo list(PmSubTeamContract pmSubTeamContract) {
|
||||
try {
|
||||
startPage();
|
||||
List<PmSubTeamContract> list = pmSubTeamContractService.selectSubTeamContractList(pmSubTeamContract);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 班组出场
|
||||
*/
|
||||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubTeamContract")
|
||||
@SysLog(title = "分包商合同信息", businessType = OperaType.UPDATE, logType = 0, module = "分包商合同信息->新增和修改分包商合同信息")
|
||||
public AjaxResult addOrUpdateSubTeamContract(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
PmSubTeamContract pmSubTeamContract = FastJsonHelper.jsonStrToBean(params, PmSubTeamContract.class);
|
||||
int res = pmSubTeamContractService.addOrUpdateSubTeamContract(pmSubTeamContract,new FileBasicMsgDto(listFile, files));
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("分包商合同信息已存在");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分包班组信息入场信息列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:teamContract:list"))
|
||||
@GetMapping("/getSubTeamContractById")
|
||||
@SysLog(title = "分包班组入场信息管理", businessType = OperaType.QUERY, logType = 0, module = "分包班组入场信息管理->分包班组入场信息列表")
|
||||
public AjaxResult getSubTeamContractById(PmSubTeamContract pmSubTeamContract) {
|
||||
try {
|
||||
PmSubTeamContract pmSubTeamContractRes = pmSubTeamContractService.getSubTeamContractById(pmSubTeamContract);
|
||||
return success(pmSubTeamContractRes);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return error();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmSubTeam;
|
||||
import com.bonus.bmw.service.PmSubTeamService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/pmSubTeam")
|
||||
public class PmSubTeamController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private PmSubTeamService pmSubTeamService;
|
||||
|
||||
/**
|
||||
* 分包班组信息列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:team:list"))
|
||||
@GetMapping("/list")
|
||||
@SysLog(title = "分包班组信息管理", businessType = OperaType.QUERY, logType = 0, module = "分包班组信息管理->分包班组信息列表")
|
||||
public TableDataInfo list(PmSubTeam pmSubTeam) {
|
||||
try {
|
||||
startPage();
|
||||
List<PmSubTeam> list = pmSubTeamService.selectSubTeamList(pmSubTeam);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增和修改分包班组信息
|
||||
*/
|
||||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubTeam")
|
||||
@SysLog(title = "分包班组信息", businessType = OperaType.UPDATE, logType = 0, module = "分包班组信息->新增和修改分包班组信息")
|
||||
public AjaxResult addOrUpdateSubTeam(@Validated @RequestBody PmSubTeam pmSubTeam) {
|
||||
try {
|
||||
int res = pmSubTeamService.addOrUpdateSubTeam(pmSubTeam);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("分包班组名称重复");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分包班组信息
|
||||
*/
|
||||
/*@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:del"))*/
|
||||
@PostMapping("/delSubTeam")
|
||||
@SysLog(title = "分包班组信息", businessType = OperaType.UPDATE, logType = 0, module = "分包班组信息->删除分包班组信息")
|
||||
public AjaxResult delSubTeam(@Validated @RequestBody PmSubTeam pmSubTeam) {
|
||||
try {
|
||||
int res = pmSubTeamService.delSubTeam(pmSubTeam);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分包班组信息
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "分包班组信息", businessType = OperaType.EXPORT, logType = 0, module = "分包班组信息->导出分包班组信息")
|
||||
public void export(HttpServletResponse response, PmSubTeam pmSubTeam) {
|
||||
try {
|
||||
List<PmSubTeam> list = pmSubTeamService.selectSubTeamList(pmSubTeam);
|
||||
ExcelUtil<PmSubTeam> util = new ExcelUtil<PmSubTeam>(PmSubTeam.class);
|
||||
util.exportExcel(response, list, "分包班组信息");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -20,11 +21,13 @@ public class BmSubContract {
|
|||
/**
|
||||
* 分包合同编码
|
||||
*/
|
||||
@Excel(name = "分包合同编码",sort = 1)
|
||||
private String subContractCode;
|
||||
|
||||
/**
|
||||
* 分包合同名称
|
||||
*/
|
||||
@Excel(name = "分包合同名称",sort = 2)
|
||||
private String subContractName;
|
||||
|
||||
/**
|
||||
|
|
@ -32,19 +35,33 @@ public class BmSubContract {
|
|||
*/
|
||||
private String subId;
|
||||
|
||||
/**
|
||||
* 分包商名称
|
||||
*/
|
||||
@Excel(name = "分包商名称",sort = 3)
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称",sort = 4)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 分包入场日期
|
||||
*/
|
||||
@Excel(name = "分包入场时间",sort = 6)
|
||||
private String subEinTime;
|
||||
|
||||
/**
|
||||
* 分包出场时间
|
||||
*/
|
||||
@Excel(name = "分包入场时间",sort = 7)
|
||||
private String subExitTime;
|
||||
|
||||
/**
|
||||
|
|
@ -77,6 +94,7 @@ public class BmSubContract {
|
|||
/**
|
||||
*1 已入场 2 已离场
|
||||
*/
|
||||
@Excel(name = "出入场状态",sort = 5,readConverterExp = "1=在场,2=出场")
|
||||
private String subEinStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Data
|
||||
public class PmSubTeam {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
@Excel(name = "班组名称",sort = 2)
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 分包id
|
||||
*/
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 分包商名称
|
||||
*/
|
||||
@Excel(name = "分包商名称",sort = 1)
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 班组长
|
||||
*/
|
||||
@Excel(name = "班组长",sort = 3)
|
||||
private String teamLeader;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@Excel(name = "联系方式",sort = 4)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 0未入场 1 已入场 2 已离场
|
||||
*/
|
||||
private String teamEinStatus;
|
||||
|
||||
/**
|
||||
*创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Data
|
||||
public class PmSubTeamContract {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Integer teamId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 分包名称
|
||||
*/
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Integer proId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 班组入场时间
|
||||
*/
|
||||
private String teamEinTime;
|
||||
|
||||
/**
|
||||
* 1 已入场 2 已离场
|
||||
*/
|
||||
private Integer teamEinStatus;
|
||||
|
||||
/**
|
||||
* 班组出场时间
|
||||
*/
|
||||
private String teamExitTime;
|
||||
|
||||
/**
|
||||
*创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Integer isActive;
|
||||
}
|
||||
|
|
@ -7,4 +7,12 @@ import java.util.List;
|
|||
|
||||
public interface BmSubContractMapper {
|
||||
List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract);
|
||||
|
||||
int updateSubContract(BmSubContract bmSubContract);
|
||||
|
||||
int addSubContract(BmSubContract bmSubContract);
|
||||
|
||||
BmSubContract getSubContractBySubContractName(BmSubContract bmSubContract);
|
||||
|
||||
int delSubContract(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmSubTeamContractMapper {
|
||||
List<PmSubTeamContract> selectSubTeamContractList(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
int updateSubTeamContract(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
PmSubTeamContract getSubTeamContractById(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
int addSubTeamContract(PmSubTeamContract pmSubTeamContract);
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmSubTeam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmSubTeamMapper {
|
||||
|
||||
/**
|
||||
* 分包班组信息列表
|
||||
*/
|
||||
List<PmSubTeam> selectSubTeamList(PmSubTeam pmSubTeam);
|
||||
|
||||
/**
|
||||
* 修改分包班组信息
|
||||
*/
|
||||
int updateSubTeam(PmSubTeam pmSubTeam);
|
||||
|
||||
/**
|
||||
* 新增分包班组信息
|
||||
*/
|
||||
int addSubTeam(PmSubTeam pmSubTeam);
|
||||
|
||||
/**
|
||||
* 删除分包班组信息
|
||||
*/
|
||||
int delSubTeam(PmSubTeam pmSubTeam);
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
|
||||
|
|
@ -7,4 +8,8 @@ import java.util.List;
|
|||
|
||||
public interface BmSubContractService {
|
||||
List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract);
|
||||
|
||||
int addOrUpdateSubContract(BmSubContract bmSubContract, FileBasicMsgDto fileBasicMsgDto);
|
||||
|
||||
int delSubContract(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmSubTeamContractService {
|
||||
List<PmSubTeamContract> selectSubTeamContractList(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
int addOrUpdateSubTeamContract(PmSubTeamContract pmSubTeamContract, FileBasicMsgDto fileBasicMsgDto);
|
||||
|
||||
PmSubTeamContract getSubTeamContractById(PmSubTeamContract pmSubTeamContract);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmSubTeam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmSubTeamService {
|
||||
/**
|
||||
* 分包班组信息列表
|
||||
*/
|
||||
List<PmSubTeam> selectSubTeamList(PmSubTeam pmSubTeam);
|
||||
|
||||
/**
|
||||
* 新增和修改分包班组信息
|
||||
*/
|
||||
int addOrUpdateSubTeam(PmSubTeam pmSubTeam);
|
||||
|
||||
/**
|
||||
* 删除分包班组信息
|
||||
*/
|
||||
int delSubTeam(PmSubTeam pmSubTeam);
|
||||
}
|
||||
|
|
@ -1,13 +1,21 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||
import com.bonus.bmw.service.BmSubContractService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -21,9 +29,61 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
@Resource
|
||||
private BmSubContractMapper bmSubContractMapper;
|
||||
|
||||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
|
||||
@Override
|
||||
public List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract) {
|
||||
return bmSubContractMapper.selectSubContractList(bmSubContract);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addOrUpdateSubContract(BmSubContract bmSubContract, FileBasicMsgDto fileBasicMsgDto) {
|
||||
//BmSubContract bmSubContractOld = bmSubContractMapper.getSubContractBySubContractName(bmSubContract);
|
||||
int res =0;
|
||||
//存在则删除后新增,不存在则新增
|
||||
if(StringUtils.isNotNull(bmSubContract.getId())){
|
||||
/*if (StringUtils.isNotNull(bmSubContractOld) && !bmSubContractOld.getId().equals(bmSubContract.getId())){
|
||||
return res;
|
||||
}*/
|
||||
bmSubContract.setUpdateUser(SecurityUtils.getUsername());
|
||||
bmSubContract.setUpdateTime(new Date());
|
||||
//出场时获取当前时间
|
||||
if ("2".equals(bmSubContract.getSubEinStatus())){
|
||||
bmSubContract.setSubExitTime(DateUtils.getDate());
|
||||
}
|
||||
res = bmSubContractMapper.updateSubContract(bmSubContract);
|
||||
}else {
|
||||
/*if (StringUtils.isNotNull(bmSubContractOld)){
|
||||
return res;
|
||||
}*/
|
||||
bmSubContract.setSubEinTime(DateUtils.getDate());
|
||||
bmSubContract.setCreateUser(SecurityUtils.getUsername());
|
||||
bmSubContract.setCreateTime(new Date());
|
||||
bmSubContract.setUpdateUser(SecurityUtils.getUsername());
|
||||
bmSubContract.setUpdateTime(new Date());
|
||||
res = bmSubContractMapper.addSubContract(bmSubContract);
|
||||
}
|
||||
//添加到文件库和minio上
|
||||
if(res > 0){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
for (int i = 0; i < fileMsg.size(); i++) {
|
||||
type[i] = fileMsg.get(i).getType();
|
||||
}
|
||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(fileBasicMsgDto.getFiles(), Constants.BM_SUB_CONTRACT, bmSubContract.getId().toString(), type,"", "");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delSubContract(BmSubContract bmSubContract) {
|
||||
//删除数据和合同图片
|
||||
int i = bmSubContractMapper.delSubContract(bmSubContract);
|
||||
//删除合同图片 删除minio文件
|
||||
fileUploadUtils.delFileListById("", bmSubContract.getId().toString(), Constants.BM_SUB_CONTRACT,"");
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
|
@ -36,6 +37,7 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int addOrUpdateSub(PmSub pmSub, FileBasicMsgDto fileBasicMsgDto) {
|
||||
PmSub pmSubOld = pmSubMapper.getSubBySubName(pmSub);
|
||||
int res =0;
|
||||
|
|
@ -79,6 +81,10 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
if (pmOrgList.size()>0){
|
||||
return 0;
|
||||
}*/
|
||||
return pmSubMapper.delSub(pmSub);
|
||||
int res = pmSubMapper.delSub(pmSub);
|
||||
//删除合同图片 删除minio文件
|
||||
fileUploadUtils.delFileListById("", pmSub.getId().toString(), Constants.PM_SUB,"");
|
||||
return res;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.mapper.PmSubTeamContractMapper;
|
||||
import com.bonus.bmw.service.PmSubTeamContractService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author 马三炮
|
||||
*@date 2025/8/15
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PmSubTeamContractServiceImpl implements PmSubTeamContractService {
|
||||
|
||||
@Resource
|
||||
private PmSubTeamContractMapper pmSubTeamContractMapper;
|
||||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
|
||||
@Override
|
||||
public List<PmSubTeamContract> selectSubTeamContractList(PmSubTeamContract pmSubTeamContract) {
|
||||
return pmSubTeamContractMapper.selectSubTeamContractList(pmSubTeamContract);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addOrUpdateSubTeamContract(PmSubTeamContract pmSubTeamContract, FileBasicMsgDto fileBasicMsgDto) {
|
||||
int res =0;
|
||||
if (StringUtils.isNotNull(pmSubTeamContract.getId())){
|
||||
pmSubTeamContract.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSubTeamContract.setUpdateTime(new Date());
|
||||
pmSubTeamContract.setTeamExitTime(DateUtils.getDate());
|
||||
res = pmSubTeamContractMapper.updateSubTeamContract(pmSubTeamContract);
|
||||
}else {
|
||||
pmSubTeamContract.setCreateUser(SecurityUtils.getUsername());
|
||||
pmSubTeamContract.setCreateTime(new Date());
|
||||
pmSubTeamContract.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSubTeamContract.setUpdateTime(new Date());
|
||||
res = pmSubTeamContractMapper.addSubTeamContract(pmSubTeamContract);
|
||||
}
|
||||
//添加到文件库和minio上
|
||||
if(res > 0){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
for (int i = 0; i < fileMsg.size(); i++) {
|
||||
type[i] = fileMsg.get(i).getType();
|
||||
}
|
||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(fileBasicMsgDto.getFiles(), Constants.PM_SUB_TEAM_CONTRACT, pmSubTeamContract.getId().toString(), type,"", "");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmSubTeamContract getSubTeamContractById(PmSubTeamContract pmSubTeamContract) {
|
||||
return pmSubTeamContractMapper.getSubTeamContractById(pmSubTeamContract);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmSubTeam;
|
||||
import com.bonus.bmw.mapper.PmSubTeamMapper;
|
||||
import com.bonus.bmw.service.PmSubTeamService;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PmSubTeamServiceImpl implements PmSubTeamService {
|
||||
|
||||
@Resource
|
||||
private PmSubTeamMapper pmSubTeamMapper;
|
||||
|
||||
/**
|
||||
* 分包班组信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<PmSubTeam> selectSubTeamList(PmSubTeam pmSubTeam) {
|
||||
return pmSubTeamMapper.selectSubTeamList(pmSubTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增和修改分包班组信息
|
||||
*/
|
||||
@Override
|
||||
public int addOrUpdateSubTeam(PmSubTeam pmSubTeam) {
|
||||
|
||||
//存在则删除后新增,不存在则新增
|
||||
if(StringUtils.isNotNull(pmSubTeam.getId())){
|
||||
pmSubTeam.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSubTeam.setUpdateTime(new Date());
|
||||
return pmSubTeamMapper.updateSubTeam(pmSubTeam);
|
||||
}else {
|
||||
pmSubTeam.setCreateUser(SecurityUtils.getUsername());
|
||||
pmSubTeam.setCreateTime(new Date());
|
||||
pmSubTeam.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSubTeam.setUpdateTime(new Date());
|
||||
return pmSubTeamMapper.addSubTeam(pmSubTeam);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分包班组信息
|
||||
*/
|
||||
@Override
|
||||
public int delSubTeam(PmSubTeam pmSubTeam) {
|
||||
return pmSubTeamMapper.delSubTeam(pmSubTeam);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,27 @@
|
|||
<?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.bonus.bmw.mapper.BmSubContractMapper">
|
||||
<insert id="addSubContract" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into bm_sub_contract (sub_contract_code, sub_contract_name, sub_id,pro_id,sub_ein_time,sub_exit_time,
|
||||
create_user, update_user, create_time, update_time,sub_ein_status)
|
||||
values (#{subContractCode}, #{subContractName},#{subId},#{proId},#{subEinTime},#{subExitTime},
|
||||
#{createUser}, #{updateUser}, #{createTime}, #{updateTime},#{subEinStatus})
|
||||
</insert>
|
||||
<update id="updateSubContract">
|
||||
update bm_sub_contract
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="subEinStatus!= null " >
|
||||
sub_ein_status=#{subEinStatus},
|
||||
</if>
|
||||
<if test="subExitTime!= null " >
|
||||
sub_exit_time=#{subExitTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="delSubContract">
|
||||
update bm_sub_contract set is_active = '0' where id =#{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectSubContractList" resultType="com.bonus.bmw.domain.vo.BmSubContractVo">
|
||||
select bsc.id as id,
|
||||
|
|
@ -17,5 +38,37 @@
|
|||
left join pm_sub ps on bsc.sub_id = ps.id
|
||||
left join pm_project pp on bsc.pro_id = pp.id
|
||||
where bsc.is_active = '1'
|
||||
<if test="subContractCode!=null and subContractCode!=''">
|
||||
and bsc.sub_contract_code LIKE CONCAT('%', #{subContractCode}, '%')
|
||||
</if>
|
||||
<if test="subContractName!=null and subContractName!=''">
|
||||
and bsc.sub_contract_name LIKE CONCAT('%', #{subContractName}, '%')
|
||||
</if>
|
||||
<if test="subName!=null and subName!=''">
|
||||
and ps.sub_name LIKE CONCAT('%', #{subName}, '%')
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
and pp.pro_name LIKE CONCAT('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="subEinStatus!=null and subEinStatus!=''">
|
||||
and bsc.sub_ein_status =#{subEinStatus}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSubContractBySubContractName" resultType="com.bonus.bmw.domain.po.BmSubContract">
|
||||
select bsc.id as id,
|
||||
bsc.sub_contract_code as subContractCode,
|
||||
bsc.sub_contract_name as subContractName,
|
||||
bsc.sub_id as subId,
|
||||
ps.sub_name as subName,
|
||||
bsc.pro_id as proId,
|
||||
pp.pro_name as proName,
|
||||
bsc.sub_ein_time as subEinTime,
|
||||
bsc.sub_exit_time as subExitTime,
|
||||
bsc.sub_ein_status as subEinStatus
|
||||
from bm_sub_contract bsc
|
||||
left join pm_sub ps on bsc.sub_id = ps.id
|
||||
left join pm_project pp on bsc.pro_id = pp.id
|
||||
where bsc.is_active = '1' and
|
||||
(bsc.sub_contract_code = #{subContractCode} or bsc.sub_contract_name = #{subContractName})
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
sub_name like concat('%', #{keyWord}, '%')
|
||||
or legal_person like concat('%', #{keyWord}, '%')
|
||||
or legal_person_phone like concat('%', #{keyWord}, '%')
|
||||
or legsub_addressal_person_phone like concat('%', #{keyWord}, '%')
|
||||
or sub_address like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
<?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.bonus.bmw.mapper.PmSubTeamContractMapper">
|
||||
<insert id="addSubTeamContract" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pm_sub_team_contract (team_id,team_name, sub_id,sub_name,pro_id,pro_name,team_ein_time,team_ein_status,
|
||||
team_exit_time,create_user, update_user, create_time, update_time)
|
||||
values (#{teamId},#{teamName}, #{subId},#{subName},#{proId},#{proName},#{teamEinTime},#{teamEinStatus},
|
||||
#{teamExitTime},#{createUser}, #{updateUser}, #{createTime}, #{updateTime})
|
||||
</insert>
|
||||
<update id="updateSubTeamContract">
|
||||
update pm_sub_team_contract
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="teamEinStatus!= null " >
|
||||
team_ein_status=#{teamEinStatus},
|
||||
</if>
|
||||
<if test="teamExitTime!= null and teamExitTime != ''" >
|
||||
team_exit_time=#{teamExitTime},
|
||||
</if>
|
||||
<if test="updateUser!= null " >
|
||||
update_user=#{updateUser},
|
||||
</if>
|
||||
<if test="updateTime!= null " >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectSubTeamContractList" resultType="com.bonus.bmw.domain.po.PmSubTeamContract">
|
||||
select id,team_id,team_name,sub_id,sub_name,pro_id,pro_name,team_ein_time,team_ein_status,team_exit_time
|
||||
from pm_sub_team_contract where is_active = '1'
|
||||
<if test="teamName!=null and teamName!= ''">
|
||||
and team_name LIKE CONCAT('%', #{teamName}, '%')
|
||||
</if>
|
||||
<if test="subName!=null and subName!= ''">
|
||||
and sub_name LIKE CONCAT('%', #{subName}, '%')
|
||||
</if>
|
||||
<if test="proName!=null and proName!= ''">
|
||||
and pro_name LIKE CONCAT('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="teamEinStatus!=null and teamEinStatus!= ''">
|
||||
and team_ein_status LIKE CONCAT('%', #{teamEinStatus}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSubTeamContractById" resultType="com.bonus.bmw.domain.po.PmSubTeamContract">
|
||||
select id,team_id,team_name,sub_id,sub_name,pro_id,pro_name,team_ein_time,team_ein_status,team_exit_time
|
||||
from pm_sub_team_contract where is_active = '1' and id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?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.bonus.bmw.mapper.PmSubTeamMapper">
|
||||
<insert id="addSubTeam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pm_sub_team (team_name,sub_id, team_leader,phone,team_ein_status, create_user, update_user, create_time, update_time)
|
||||
values (#{teamName},#{subId}, #{teamLeader},#{phone},#{teamEinStatus}, #{createUser}, #{updateUser}, #{createTime}, #{updateTime})
|
||||
</insert>
|
||||
<update id="updateSubTeam">
|
||||
update pm_sub_team
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="teamName!= null " >
|
||||
team_name=#{teamName},
|
||||
</if>
|
||||
<if test="teamLeader!= null and teamLeader != ''" >
|
||||
team_leader=#{teamLeader},
|
||||
</if>
|
||||
<if test="phone!= null and phone != ''" >
|
||||
phone=#{phone},
|
||||
</if>
|
||||
<if test="teamEinStatus!= null " >
|
||||
team_ein_status=#{teamEinStatus},
|
||||
</if>
|
||||
<if test="updateUser!= null " >
|
||||
update_user=#{updateUser},
|
||||
</if>
|
||||
<if test="updateTime!= null " >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="delSubTeam">
|
||||
update pm_sub_team set is_active = '0' where id =#{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectSubTeamList" resultType="com.bonus.bmw.domain.po.PmSubTeam">
|
||||
select pst.id as id,
|
||||
pst.team_name as teamName,
|
||||
pst.sub_id as subId,
|
||||
ps.sub_name as subName,
|
||||
pst.team_leader as teamLeader,
|
||||
pst.phone as phone,
|
||||
pst.team_ein_status as teamEinStatus
|
||||
from pm_sub_team pst
|
||||
left join pm_sub ps on ps.id = pst.sub_id
|
||||
where pst.is_active = '1'
|
||||
<if test="keyWord !=null and keyWord!= ''" >
|
||||
and (
|
||||
ps.sub_name like concat('%', #{keyWord}, '%')
|
||||
or pst.team_name like concat('%', #{keyWord}, '%')
|
||||
or pst.team_leader like concat('%', #{keyWord}, '%')
|
||||
or pst.phone like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue