产前准备

philip 4 years ago
parent 4148378a4b
commit 387393941f

@ -48,13 +48,13 @@ import java.util.Map;
@Transactional(rollbackFor = Exception.class)
public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, ProdReadyTask> implements ProdReadyTaskService {
public static final String P01="P01";
public static final String P02="P02";
public static final String P03="P03";
public static final String STATUS_NEW="NEW";
public static final String STATUS_DOING="DOING";
public static final String STATUS_FINISH="FINISH";
public static final String STATUS_CANCEL="CANCEL";
public static final String P01 = "P01";
public static final String P02 = "P02";
public static final String P03 = "P03";
public static final String STATUS_NEW = "NEW";
public static final String STATUS_DOING = "DOING";
public static final String STATUS_FINISH = "FINISH";
public static final String STATUS_CANCEL = "CANCEL";
@Autowired
private ProdReadyTaskMapper prodReadyTaskMapper;
@ -68,6 +68,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
private ShopOrderService shopOrderService;
@Autowired
private WorkCenterService workCenterService;
@Override
public IPage<ProdReadyTask> selectPage(FrontPage<ProdReadyTask> frontPage, ProdReadyTask prodReadyTask) {
QueryWrapper<ProdReadyTask> queryWrapper = new QueryWrapper<>();
@ -83,122 +84,134 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
}
@Override
public void createTask(List<SfcDispatchDto> sfcDispatchDtoList) {
public void createTask(List<SfcDispatchDto> sfcDispatchDtoList) {
//根据站点及派工BO查询数据
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
for (SfcDispatchDto sfcDispatchDto: sfcDispatchDtoList) {
String sfcDispatchBO=sfcDispatchDto.getHandle();
String dispatchStatus=sfcDispatchDto.getDispatchStatus();
String shopOrder=sfcDispatchDto.getShopOrder();
String sfc=sfcDispatchDto.getSfc();
String operation=sfcDispatchDto.getOperation();
String resrce=sfcDispatchDto.getResrce();
String stepId=sfcDispatchDto.getStepId();
String workCenter=sfcDispatchDto.getWorkCenter();
for (SfcDispatchDto sfcDispatchDto : sfcDispatchDtoList) {
String sfcDispatchBO = sfcDispatchDto.getHandle();
String dispatchStatus = sfcDispatchDto.getDispatchStatus();
String shopOrder = sfcDispatchDto.getShopOrder();
String sfc = sfcDispatchDto.getSfc();
String operation = sfcDispatchDto.getOperation();
String resrce = sfcDispatchDto.getResrce();
String stepId = sfcDispatchDto.getStepId();
String workCenter = sfcDispatchDto.getWorkCenter();
ShopOrder byId = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, shopOrder));
if (DispatchStatusEnum.RELEASE.getCode().equals(dispatchStatus)) {
ProdReadyTask prodReadyTask=new ProdReadyTask();
prodReadyTask.setSite(site);
prodReadyTask.setTaskNo(StringUtil.createQUID());
prodReadyTask.setHandle(HandleEnum.PROD_READY_TASK.getHandle(site,prodReadyTask.getTaskNo()));
prodReadyTask.setSfcDispatchBo(sfcDispatchBO);
prodReadyTask.setShopOrder(shopOrder);
prodReadyTask.setWorkCenter(workCenter);
prodReadyTask.setSfc(sfc);
prodReadyTask.setOperation(operation);
prodReadyTask.setStepId(stepId);
prodReadyTask.setItem(StringUtil.trimHandle(byId.getItemBo()));
prodReadyTask.setResrce(resrce);
prodReadyTask.setCreateUser(user);
prodReadyTask.setCreatedDateTime(LocalDateTime.now());
prodReadyTask.setModifyUser(user);
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
List<ProdReadyTaskDetail> prodReadyTaskDetailList = new ArrayList<>();
ShopOrder byId = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, shopOrder));
if (DispatchStatusEnum.RELEASE.getCode().equals(dispatchStatus)) {
ProdReadyTask prodReadyTask = new ProdReadyTask();
prodReadyTask.setSite(site);
prodReadyTask.setTaskNo(StringUtil.createQUID());
prodReadyTask.setHandle(HandleEnum.PROD_READY_TASK.getHandle(site, prodReadyTask.getTaskNo()));
prodReadyTask.setSfcDispatchBo(sfcDispatchBO);
prodReadyTask.setShopOrder(shopOrder);
prodReadyTask.setWorkCenter(workCenter);
prodReadyTask.setSfc(sfc);
prodReadyTask.setOperation(operation);
prodReadyTask.setStepId(stepId);
prodReadyTask.setItem(StringUtil.trimHandle(byId.getItemBo()));
prodReadyTask.setResrce(resrce);
prodReadyTask.setCreateUser(user);
prodReadyTask.setCreatedDateTime(LocalDateTime.now());
prodReadyTask.setModifyUser(user);
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
List<ProdReadyTaskDetail> prodReadyTaskDetailList = new ArrayList<>();
String sfcBo = HandleEnum.SFC.getHandle(site, sfc);
List<BomComponentDto> bomComponentList = bomComponentService.getSfcBomComponent(sfcBo);
if (!bomComponentList.isEmpty()){
bomComponentList.forEach(bomComponentDto ->{
if (bomComponentDto.getOperation().equals(operation)&&bomComponentDto.getStepId().equals(stepId)){
String accessoryType = bomComponentDto.getAccessoryType();
//物料P001校验当前派工单SFC+工序/步骤)加工是否需要准备物料
if (accessoryType==null||accessoryType.equals("0")){
ProdReadyTaskDetail prodReadyTaskDetail=new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(),P01));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P01);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
}else if (accessoryType.equals("1")){
//刀具P002校验当前派工单SFC+工序/步骤)加工是否需要准备物料
ProdReadyTaskDetail prodReadyTaskDetail=new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(),P02));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P02);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
String sfcBo = HandleEnum.SFC.getHandle(site, sfc);
List<BomComponentDto> bomComponentList = bomComponentService.getSfcBomComponent(sfcBo);
if (!bomComponentList.isEmpty()) {
for (BomComponentDto bomComponentDto : bomComponentList) {
if (bomComponentDto.getOperation().equals(operation) && bomComponentDto.getStepId().equals(stepId)) {
String accessoryType = bomComponentDto.getAccessoryType();
//物料P001校验当前派工单SFC+工序/步骤)加工是否需要准备物料
if (accessoryType == null || accessoryType.equals("0")) {
if (prodReadyTaskDetailList.size()>0){
long count = prodReadyTaskDetailList.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P01)).count();
if (count>0){
continue;
}
}
ProdReadyTaskDetail prodReadyTaskDetail = new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(), P01));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P01);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
} else if (accessoryType.equals("1")) {
if (prodReadyTaskDetailList.size()>0){
long count = prodReadyTaskDetailList.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P02)).count();
if (count>0){
continue;
}
}
//刀具P002校验当前派工单SFC+工序/步骤)加工是否需要准备物料
ProdReadyTaskDetail prodReadyTaskDetail = new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(), P02));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P02);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
}
}
}
} );
}
//工控程序P003工控程序校验是否需要准备工控程序
String customFieldsValue = customFieldsService.getCustomFieldsValue(HandleEnum.WORK_CENTER.getHandle(site, workCenter), CustomFieldConstant.WORK_CENTER_CUSTOM_FIELD_PROCESS_CONTROL);
if (StringUtil.notBlank(customFieldsValue)&&customFieldsValue.equals(Constants.STATUS_Y)){
customFieldsValue = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PROCESS_CONTROL);
if (StringUtil.notBlank(customFieldsValue)&&customFieldsValue.equals(Constants.STATUS_Y)) {
ProdReadyTaskDetail prodReadyTaskDetail=new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(),P03));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P03);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
}
//工控程序P003工控程序校验是否需要准备工控程序
String customFieldsValue = customFieldsService.getCustomFieldsValue(HandleEnum.WORK_CENTER.getHandle(site, workCenter), CustomFieldConstant.WORK_CENTER_CUSTOM_FIELD_PROCESS_CONTROL);
if (StringUtil.notBlank(customFieldsValue) && customFieldsValue.equals(Constants.STATUS_Y)) {
customFieldsValue = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PROCESS_CONTROL);
if (StringUtil.notBlank(customFieldsValue) && customFieldsValue.equals(Constants.STATUS_Y)) {
ProdReadyTaskDetail prodReadyTaskDetail = new ProdReadyTaskDetail();
prodReadyTaskDetail.setHandle(HandleEnum.PROD_READY_TASK_DETAIL.getHandle(prodReadyTask.getHandle(), P03));
prodReadyTaskDetail.setProdReadyTaskBo(prodReadyTask.getHandle());
prodReadyTaskDetail.setInspectionItem(P03);
prodReadyTaskDetail.setResult("");
prodReadyTaskDetail.setRemarks("");
prodReadyTaskDetail.setCreateUser(user);
prodReadyTaskDetail.setCreatedDateTime(LocalDateTime.now());
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailList.add(prodReadyTaskDetail);
}
}
if (prodReadyTaskDetailList.size() > 0) {
prodReadyTask.setStatus(STATUS_NEW);
prodReadyTaskDetailService.saveBatch(prodReadyTaskDetailList);
} else {
prodReadyTask.setStatus(STATUS_FINISH);
prodReadyTask.setResult(Constants.RSESULT_OK);
prodReadyTask.setCompleteUser(user);
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
}
save(prodReadyTask);
} else if (DispatchStatusEnum.CANCEL.getCode().equals(dispatchStatus)) {
LambdaQueryWrapper<ProdReadyTask> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ProdReadyTask::getSfcDispatchBo, sfcDispatchBO);
lambdaQueryWrapper.orderByDesc(ProdReadyTask::getCreatedDateTime);
List<ProdReadyTask> list = list(lambdaQueryWrapper);
if (list.size() < 1) {
throw new BaseException("根据派工主键未找到产前准备任务");
}
if (list.get(0).getStatus().equals(STATUS_CANCEL)) {
throw new BaseException("产前准备任务任务已取消");
}
LambdaUpdateWrapper<ProdReadyTask> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(ProdReadyTask::getStatus, STATUS_CANCEL);
updateWrapper.set(ProdReadyTask::getCancelUser, user);
updateWrapper.set(ProdReadyTask::getCancelDateTime, LocalDateTime.now());
updateWrapper.eq(ProdReadyTask::getSfcDispatchBo, sfcDispatchBO);
update(updateWrapper);
}
if (prodReadyTaskDetailList.size()>0){
prodReadyTask.setStatus(STATUS_NEW);
prodReadyTaskDetailService.saveBatch(prodReadyTaskDetailList);
}else {
prodReadyTask.setStatus(STATUS_FINISH);
prodReadyTask.setResult(Constants.RSESULT_OK);
prodReadyTask.setCompleteUser(user);
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
}
save(prodReadyTask);
}else if(DispatchStatusEnum.CANCEL.getCode().equals(dispatchStatus)){
LambdaQueryWrapper<ProdReadyTask> lambdaQueryWrapper=new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ProdReadyTask::getSfcDispatchBo,sfcDispatchBO);
lambdaQueryWrapper.orderByDesc(ProdReadyTask::getCreatedDateTime);
List<ProdReadyTask> list = list(lambdaQueryWrapper);
if (list.size()<1){
throw new BaseException("根据派工主键未找到产前准备任务");
}
if (list.get(0).getStatus().equals(STATUS_CANCEL)){
throw new BaseException("产前准备任务任务已取消");
}
LambdaUpdateWrapper<ProdReadyTask> updateWrapper=new LambdaUpdateWrapper<>();
updateWrapper.set(ProdReadyTask::getStatus,STATUS_CANCEL);
updateWrapper.set(ProdReadyTask::getCancelUser,user);
updateWrapper.set(ProdReadyTask::getCancelDateTime,LocalDateTime.now());
updateWrapper.eq(ProdReadyTask::getSfcDispatchBo,sfcDispatchBO);
update(updateWrapper);
}
}
}
@ -210,7 +223,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
@Override
public ProdReadyTask loadProExecute(String taskBo) {
ProdReadyTask prodReadyTask = prodReadyTaskMapper.selectById(taskBo);
if (prodReadyTask.getStatus().equals(STATUS_NEW)){
if (prodReadyTask.getStatus().equals(STATUS_NEW)) {
prodReadyTask.setReadyUser(CommonMethods.getUser());
prodReadyTask.setReadyDateTime(LocalDateTime.now());
prodReadyTask.setModifyUser(CommonMethods.getUser());
@ -218,14 +231,14 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
prodReadyTask.setStatus(STATUS_DOING);
updateById(prodReadyTask);
}
WorkCenter workCenter=new WorkCenter();
WorkCenter workCenter = new WorkCenter();
workCenter.setWorkCenter(prodReadyTask.getWorkCenter());
workCenter.setSite(CommonMethods.getSite());
List<WorkCenter> workCenters = workCenterService.selectList(workCenter);
prodReadyTask.setWorkCenterDesc(workCenters.get(0).getDescription());
prodReadyTask.setDispatchNo(StringUtil.trimHandle(prodReadyTask.getSfcDispatchBo()));
LambdaQueryWrapper<ProdReadyTaskDetail> lambdaQuery=new LambdaQueryWrapper<>();
lambdaQuery.eq(ProdReadyTaskDetail::getProdReadyTaskBo,taskBo);
LambdaQueryWrapper<ProdReadyTaskDetail> lambdaQuery = new LambdaQueryWrapper<>();
lambdaQuery.eq(ProdReadyTaskDetail::getProdReadyTaskBo, taskBo);
List<ProdReadyTaskDetail> list = prodReadyTaskDetailService.list(lambdaQuery);
prodReadyTask.setProdReadyTaskDetailList(list);
return prodReadyTask;
@ -237,13 +250,13 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
String dispatchNo = param.get("dispatchNo");
List<Map<String, Object>> returnMap = null;
String site = CommonMethods.getSite();
if (type.equals(P01)){
if (type.equals(P01)) {
//物料接收数据
returnMap=prodReadyTaskMapper.getItemDetail(site,LocaleContextHolder.getLocale().getLanguage(),dispatchNo);
}else if (type.equals(P02)){
returnMap = prodReadyTaskMapper.getItemDetail(site, LocaleContextHolder.getLocale().getLanguage(), dispatchNo);
} else if (type.equals(P02)) {
//刀具
returnMap=prodReadyTaskMapper.getToolDetail(site,LocaleContextHolder.getLocale().getLanguage(),dispatchNo);
}else {
returnMap = prodReadyTaskMapper.getToolDetail(site, LocaleContextHolder.getLocale().getLanguage(), dispatchNo);
} else {
//通过加工的零件号、设备类型、设备获取发布状态的工控程序
}
return returnMap;
@ -253,10 +266,10 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
public boolean saveResult(ProdReadyTask prodReadyTask) {
String user = CommonMethods.getUser();
ProdReadyTask byId = getById(prodReadyTask.getHandle());
if (byId.getStatus().equals(STATUS_CANCEL)){
if (byId.getStatus().equals(STATUS_CANCEL)) {
throw new BaseException("产前准备任务任务已取消");
}
if (byId.getStatus().equals(STATUS_FINISH)){
if (byId.getStatus().equals(STATUS_FINISH)) {
throw new BaseException("产前准备任务任务已完成");
}
List<ProdReadyTaskDetail> prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList();
@ -266,8 +279,8 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
prodReadyTask.setModifyUser(user);
prodReadyTask.setModifiedDateTime(LocalDateTime.now());
boolean update = updateById(prodReadyTask);
if (prodReadyTaskDetailList!=null&&prodReadyTaskDetailList.size()>0){
for (ProdReadyTaskDetail prodReadyTaskDetail:prodReadyTaskDetailList) {
if (prodReadyTaskDetailList != null && prodReadyTaskDetailList.size() > 0) {
for (ProdReadyTaskDetail prodReadyTaskDetail : prodReadyTaskDetailList) {
prodReadyTaskDetail.setModifyUser(user);
prodReadyTaskDetail.setModifiedDateTime(LocalDateTime.now());
prodReadyTaskDetailService.updateById(prodReadyTaskDetail);

@ -41,5 +41,9 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>com.foreverwin.mesnac</groupId>
<artifactId>production</artifactId>
</dependency>
</dependencies>
</project>

@ -1,271 +0,0 @@
package com.foreverwin.mesnac.quality.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.quality.mapper.InspectionProjectDetailMapper;
import com.foreverwin.mesnac.quality.mapper.InspectionProjectMapper;
import com.foreverwin.mesnac.quality.model.InspectionProject;
import com.foreverwin.mesnac.quality.model.InspectionProjectDetail;
import com.foreverwin.mesnac.quality.service.InspectionProjectDetailService;
import com.foreverwin.mesnac.quality.service.InspectionProjectService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import com.visiprise.common.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
*
* @author Robert
* @since 2021-06-03
*/
@RestController
@RequestMapping("/Z-INSPECTION-PROJECT")
public class InspectionProjectController {
@Autowired
public InspectionProjectService inspectionProjectService;
@Autowired
public InspectionProjectMapper inspectionProjectMapper;
@Autowired
public InspectionProjectDetailMapper inspectionProjectDetailMapper;
@Autowired
public InspectionProjectDetailService inspectionProjectDetailService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInspectionProjectById(@PathVariable String id) {
return R.ok( inspectionProjectService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInspectionProjectList(InspectionProject inspectionProject){
List<InspectionProject> result;
QueryWrapper<InspectionProject> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProject);
result = inspectionProjectService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<InspectionProject> frontPage, InspectionProject inspectionProject){
IPage result;
QueryWrapper<InspectionProject> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProject);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(InspectionProject::getHandle, frontPage.getGlobalQuery())
.or().like(InspectionProject::getSite, frontPage.getGlobalQuery())
.or().like(InspectionProject::getInspectProjectNo, frontPage.getGlobalQuery())
.or().like(InspectionProject::getInspectType, frontPage.getGlobalQuery())
.or().like(InspectionProject::getRevision, frontPage.getGlobalQuery())
.or().like(InspectionProject::getCurrentRevision, frontPage.getGlobalQuery())
.or().like(InspectionProject::getDescription, frontPage.getGlobalQuery())
.or().like(InspectionProject::getStatus, frontPage.getGlobalQuery())
.or().like(InspectionProject::getItemBo, frontPage.getGlobalQuery())
.or().like(InspectionProject::getItem, frontPage.getGlobalQuery())
.or().like(InspectionProject::getOperation, frontPage.getGlobalQuery())
.or().like(InspectionProject::getStepId, frontPage.getGlobalQuery())
.or().like(InspectionProject::getSubStep, frontPage.getGlobalQuery())
.or().like(InspectionProject::getCreateUser, frontPage.getGlobalQuery())
.or().like(InspectionProject::getModifyUser, frontPage.getGlobalQuery())
);
}
result = inspectionProjectService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inspectionProject
* @return null
*/
@PostMapping
public R save(@RequestBody InspectionProject inspectionProject) {
return R.ok(inspectionProjectService.save(inspectionProject));
}
/**
*
* @param inspectionProject
* @return null
*/
@PutMapping
public R updateById(@RequestBody InspectionProject inspectionProject) {
return R.ok(inspectionProjectService.updateById(inspectionProject));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inspectionProjectService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(inspectionProjectService.removeByIds(ids));
}
@PostMapping("/saveAll")
public R saveAll(@RequestBody InspectionProject inspectionProject){
boolean b = false;
if(StringUtil.isEmpty(inspectionProject.getInspectProjectNo())){
b = true;
inspectionProject.setInspectProjectNo(inspectionProjectService.InspectProjectNoGenerationRules(inspectionProject));
}
inspectionProject.setSite(CommonMethods.getSite());
inspectionProject.setHandle("InspectionProjectBO:"+inspectionProject.getSite()+","+inspectionProject.getInspectProjectNo()+","+inspectionProject.getRevision());
//保存检验项目维护-副
//移除
HashMap<String, Object> removeCondition = new HashMap<>();
removeCondition.put("INSPECT_PROJECT_BO",inspectionProject.getHandle());
inspectionProjectDetailService.removeByMap(removeCondition);
if(null != inspectionProject.getInspectionProjectDetailList() && inspectionProject.getInspectionProjectDetailList().size() > 0){
List<InspectionProjectDetail> inspectionProjectDetailList = inspectionProject.getInspectionProjectDetailList();
for (InspectionProjectDetail inspectionProjectDetail : inspectionProjectDetailList) {
inspectionProjectDetail.setHandle(UUID.randomUUID().toString());
inspectionProjectDetail.setInspectProjectBo(inspectionProject.getHandle());
inspectionProjectDetail.setCreatedDateTime(LocalDateTime.now());
inspectionProjectDetail.setCreateUser(CommonMethods.getUser());
inspectionProjectDetail.setModifiedDateTime(LocalDateTime.now());
inspectionProjectDetail.setModifyUser(CommonMethods.getUser());
}
//保存
inspectionProjectDetailService.saveBatch(inspectionProjectDetailList);
}
//保存检验项目维护-主
if(inspectionProject.selectById(inspectionProject.getHandle()) == null){
inspectionProject.setCreatedDateTime(LocalDateTime.now());
inspectionProject.setCreateUser(CommonMethods.getUser());
inspectionProject.setModifiedDateTime(LocalDateTime.now());
inspectionProject.setModifyUser(CommonMethods.getUser());
inspectionProjectService.save(inspectionProject);
}else{
inspectionProject.setModifiedDateTime(LocalDateTime.now());
inspectionProject.setModifyUser(CommonMethods.getUser());
if(b){
throw new BaseException("请先检索再保存");
}
inspectionProjectService.saveOrUpdate(inspectionProject);
}
return R.ok();
}
@PostMapping("/deleteById")
public R deleteById(@RequestBody InspectionProject inspectionProject){
boolean bool = false;
if(StringUtil.isEmpty(inspectionProject.getInspectProjectNo())){
inspectionProject.setInspectProjectNo(inspectionProjectService.InspectProjectNoGenerationRules(inspectionProject));
bool = true;
}
inspectionProject.setSite(CommonMethods.getSite());
inspectionProject.setHandle("InspectionProjectBO:"+inspectionProject.getSite()+","+inspectionProject.getInspectProjectNo()+","+inspectionProject.getRevision());
HashMap<String, Object> removeCondition = new HashMap<>();
removeCondition.put("INSPECT_PROJECT_BO",inspectionProject.getHandle());
inspectionProjectDetailService.removeByMap(removeCondition);
boolean b = inspectionProjectService.removeById(inspectionProject);
if(bool){
if(b){
throw new BaseException("请先检索再保存");
}
}
return R.ok();
}
@GetMapping("/queryAll")
public R queryAll(InspectionProject inspectionProject){
if(StringUtil.isEmpty(inspectionProject.getInspectProjectNo())){
inspectionProject.setInspectProjectNo(inspectionProjectService.InspectProjectNoGenerationRules(inspectionProject));
}
if(StringUtil.isEmpty(inspectionProject.getRevision())){
String revision = inspectionProjectService.findRevisionByCurrentRevision(inspectionProject.getInspectProjectNo());
if(StringUtil.isEmpty(revision)){
throw new BaseException("请输入版本号");
}
inspectionProject.setRevision(revision);
}
inspectionProject.setSite(CommonMethods.getSite());
inspectionProject.setHandle("InspectionProjectBO:"+inspectionProject.getSite()+","+inspectionProject.getInspectProjectNo()+","+inspectionProject.getRevision());
HashMap<String, Object> findCondition = new HashMap<>();
findCondition.put("INSPECT_PROJECT_BO",inspectionProject.getHandle());
List<InspectionProjectDetail> inspectionProjectDetails = inspectionProjectDetailMapper.selectByMap(findCondition);
InspectionProject handle = inspectionProjectMapper.selectById(inspectionProject.getHandle());
handle.setInspectionProjectDetailList(inspectionProjectDetails);
if(null == handle){
throw new BaseException("根据此项目编号以及版本未检索到数据");
}
return R.ok(handle);
}
}

@ -1,130 +0,0 @@
package com.foreverwin.mesnac.quality.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.quality.service.InspectionProjectDetailService;
import com.foreverwin.mesnac.quality.model.InspectionProjectDetail;
import java.util.List;
/**
*
* @author Robert
* @since 2021-06-03
*/
@RestController
@RequestMapping("/Z-INSPECTION-PROJECT-DETAIL")
public class InspectionProjectDetailController {
@Autowired
public InspectionProjectDetailService inspectionProjectDetailService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInspectionProjectDetailById(@PathVariable String id) {
return R.ok( inspectionProjectDetailService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInspectionProjectDetailList(InspectionProjectDetail inspectionProjectDetail){
List<InspectionProjectDetail> result;
QueryWrapper<InspectionProjectDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProjectDetail);
result = inspectionProjectDetailService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<InspectionProjectDetail> frontPage, InspectionProjectDetail inspectionProjectDetail){
IPage result;
QueryWrapper<InspectionProjectDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProjectDetail);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(InspectionProjectDetail::getHandle, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getInspectProjectBo, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getParamNo, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getDescription, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getInspectMethod, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getParamType, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getParamUnit, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getStandardValue, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getFalseValue, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getTrueValue, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getIsRequired, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getCreateUser, frontPage.getGlobalQuery())
.or().like(InspectionProjectDetail::getModifyUser, frontPage.getGlobalQuery())
);
}
result = inspectionProjectDetailService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inspectionProjectDetail
* @return null
*/
@PostMapping
public R save(@RequestBody InspectionProjectDetail inspectionProjectDetail) {
return R.ok(inspectionProjectDetailService.save(inspectionProjectDetail));
}
/**
*
* @param inspectionProjectDetail
* @return null
*/
@PutMapping
public R updateById(@RequestBody InspectionProjectDetail inspectionProjectDetail) {
return R.ok(inspectionProjectDetailService.updateById(inspectionProjectDetail));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inspectionProjectDetailService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(inspectionProjectDetailService.removeByIds(ids));
}
}

@ -12,6 +12,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
*
@ -24,7 +25,17 @@ public class SelfReportController {
@Autowired
public SelfReportService selfReportService;
/**
*
*
* @return
*/
@ResponseBody
@PostMapping("/doAdd")
public R doAdd(@RequestBody Map<String,Object> map){
selfReportService.doAdd(map);
return R.ok();
}
/**
* id
*

@ -1,12 +0,0 @@
package com.foreverwin.mesnac.quality.dto;
import com.foreverwin.mesnac.quality.model.InspectionProject;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-06-03
*/
public class inspectionProjectDto extends InspectionProject {
private String seq;
}

@ -1,18 +0,0 @@
package com.foreverwin.mesnac.quality.mapper;
import com.foreverwin.mesnac.quality.model.InspectionProjectDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* - Mapper
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@Repository
public interface InspectionProjectDetailMapper extends BaseMapper<InspectionProjectDetail> {
}

@ -1,20 +0,0 @@
package com.foreverwin.mesnac.quality.mapper;
import com.foreverwin.mesnac.quality.model.InspectionProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>
* - Mapper
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@Repository
public interface InspectionProjectMapper extends BaseMapper<InspectionProject> {
String findRevisionByCurrentRevision(@Param("site")String site, @Param("inspectProjectNo") String inspectProjectNo);
}

@ -1,328 +0,0 @@
package com.foreverwin.mesnac.quality.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@TableName("Z_INSPECTION_PROJECT")
public class InspectionProject extends Model<InspectionProject> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
* ++/+
*/
@TableField("INSPECT_PROJECT_NO")
private String inspectProjectNo;
/**
* :S|HZP
*/
@TableField("INSPECT_TYPE")
private String inspectType;
/**
*
*/
@TableField("REVISION")
private String revision;
/**
* TRUEFALSE
*/
@TableField("CURRENT_REVISION")
private String currentRevision;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
* YN
*/
@TableField("STATUS")
private String status;
/**
* BO
*/
@TableField("ITEM_BO")
private String itemBo;
/**
*
*/
@TableField("ITEM")
private String item;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
*
*/
@TableField("STEP_ID")
private String stepId;
/**
* /
*/
@TableField("SUB_STEP")
private String subStep;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
*
*/
@TableField(exist = false)
private List<InspectionProjectDetail> inspectionProjectDetailList;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getInspectProjectNo() {
return inspectProjectNo;
}
public void setInspectProjectNo(String inspectProjectNo) {
this.inspectProjectNo = inspectProjectNo;
}
public String getInspectType() {
return inspectType;
}
public void setInspectType(String inspectType) {
this.inspectType = inspectType;
}
public String getRevision() {
return revision;
}
public void setRevision(String revision) {
this.revision = revision;
}
public String getCurrentRevision() {
return currentRevision;
}
public void setCurrentRevision(String currentRevision) {
this.currentRevision = currentRevision;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getSubStep() {
return subStep;
}
public void setSubStep(String subStep) {
this.subStep = subStep;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public List<InspectionProjectDetail> getInspectionProjectDetailList() {
return inspectionProjectDetailList;
}
public void setInspectionProjectDetailList(List<InspectionProjectDetail> inspectionProjectDetailList) {
this.inspectionProjectDetailList = inspectionProjectDetailList;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String INSPECT_PROJECT_NO = "INSPECT_PROJECT_NO";
public static final String INSPECT_TYPE = "INSPECT_TYPE";
public static final String REVISION = "REVISION";
public static final String CURRENT_REVISION = "CURRENT_REVISION";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String STATUS = "STATUS";
public static final String ITEM_BO = "ITEM_BO";
public static final String ITEM = "ITEM";
public static final String OPERATION = "OPERATION";
public static final String STEP_ID = "STEP_ID";
public static final String SUB_STEP = "SUB_STEP";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InspectionProject{" +
"handle = " + handle +
", site = " + site +
", inspectProjectNo = " + inspectProjectNo +
", inspectType = " + inspectType +
", revision = " + revision +
", currentRevision = " + currentRevision +
", description = " + description +
", status = " + status +
", itemBo = " + itemBo +
", item = " + item +
", operation = " + operation +
", stepId = " + stepId +
", subStep = " + subStep +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -1,361 +0,0 @@
package com.foreverwin.mesnac.quality.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@TableName("Z_INSPECTION_PROJECT_DETAIL")
public class InspectionProjectDetail extends Model<InspectionProjectDetail> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
* -
*/
@TableField("INSPECT_PROJECT_BO")
private String inspectProjectBo;
/**
*
*/
@TableField("SEQ")
private Long seq;
/**
*
*/
@TableField("PARAM_NO")
private String paramNo;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
*
*/
@TableField("INSPECT_METHOD")
private String inspectMethod;
/**
* NB T
*/
@TableField("PARAM_TYPE")
private String paramType;
/**
*
*/
@TableField("PARAM_UNIT")
private String paramUnit;
/**
*
*/
@TableField("DECIMAL_NUM")
private Long decimalNum;
/**
*
*/
@TableField("MIN_VALUE")
private Double minValue;
/**
*
*/
@TableField("STANDARD_VALUE")
private String standardValue;
/**
*
*/
@TableField("MAX_VALUE")
private Double maxValue;
/**
* FALSE
*/
@TableField("FALSE_VALUE")
private String falseValue;
/**
* TRUE
*/
@TableField("TRUE_VALUE")
private String trueValue;
/**
* TRUEFALSE
*/
@TableField("IS_REQUIRED")
private String isRequired;
/**
*
*/
@TableField("CHECK_NUM")
private Long checkNum;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getInspectProjectBo() {
return inspectProjectBo;
}
public void setInspectProjectBo(String inspectProjectBo) {
this.inspectProjectBo = inspectProjectBo;
}
public Long getSeq() {
return seq;
}
public void setSeq(Long seq) {
this.seq = seq;
}
public String getParamNo() {
return paramNo;
}
public void setParamNo(String paramNo) {
this.paramNo = paramNo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getInspectMethod() {
return inspectMethod;
}
public void setInspectMethod(String inspectMethod) {
this.inspectMethod = inspectMethod;
}
public String getParamType() {
return paramType;
}
public void setParamType(String paramType) {
this.paramType = paramType;
}
public String getParamUnit() {
return paramUnit;
}
public void setParamUnit(String paramUnit) {
this.paramUnit = paramUnit;
}
public Long getDecimalNum() {
return decimalNum;
}
public void setDecimalNum(Long decimalNum) {
this.decimalNum = decimalNum;
}
public Double getMinValue() {
return minValue;
}
public void setMinValue(Double minValue) {
this.minValue = minValue;
}
public String getStandardValue() {
return standardValue;
}
public void setStandardValue(String standardValue) {
this.standardValue = standardValue;
}
public Double getMaxValue() {
return maxValue;
}
public void setMaxValue(Double maxValue) {
this.maxValue = maxValue;
}
public String getFalseValue() {
return falseValue;
}
public void setFalseValue(String falseValue) {
this.falseValue = falseValue;
}
public String getTrueValue() {
return trueValue;
}
public void setTrueValue(String trueValue) {
this.trueValue = trueValue;
}
public String getIsRequired() {
return isRequired;
}
public void setIsRequired(String isRequired) {
this.isRequired = isRequired;
}
public Long getCheckNum() {
return checkNum;
}
public void setCheckNum(Long checkNum) {
this.checkNum = checkNum;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String INSPECT_PROJECT_BO = "INSPECT_PROJECT_BO";
public static final String SEQ = "SEQ";
public static final String PARAM_NO = "PARAM_NO";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String INSPECT_METHOD = "INSPECT_METHOD";
public static final String PARAM_TYPE = "PARAM_TYPE";
public static final String PARAM_UNIT = "PARAM_UNIT";
public static final String DECIMAL_NUM = "DECIMAL_NUM";
public static final String MIN_VALUE = "MIN_VALUE";
public static final String STANDARD_VALUE = "STANDARD_VALUE";
public static final String MAX_VALUE = "MAX_VALUE";
public static final String FALSE_VALUE = "FALSE_VALUE";
public static final String TRUE_VALUE = "TRUE_VALUE";
public static final String IS_REQUIRED = "IS_REQUIRED";
public static final String CHECK_NUM = "CHECK_NUM";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InspectionProjectDetail{" +
"handle = " + handle +
", inspectProjectBo = " + inspectProjectBo +
", seq = " + seq +
", paramNo = " + paramNo +
", description = " + description +
", inspectMethod = " + inspectMethod +
", paramType = " + paramType +
", paramUnit = " + paramUnit +
", decimalNum = " + decimalNum +
", minValue = " + minValue +
", standardValue = " + standardValue +
", maxValue = " + maxValue +
", falseValue = " + falseValue +
", trueValue = " + trueValue +
", isRequired = " + isRequired +
", checkNum = " + checkNum +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -1,28 +0,0 @@
package com.foreverwin.mesnac.quality.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.InspectionProjectDetail;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
public interface InspectionProjectDetailService extends IService<InspectionProjectDetail> {
/**
*
* @param frontPage
* @return
*/
IPage<InspectionProjectDetail> selectPage(FrontPage<InspectionProjectDetail> frontPage, InspectionProjectDetail inspectionProjectDetail);
List<InspectionProjectDetail> selectList(InspectionProjectDetail inspectionProjectDetail);
}

@ -1,33 +0,0 @@
package com.foreverwin.mesnac.quality.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.InspectionProject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
public interface InspectionProjectService extends IService<InspectionProject> {
/**
*
* @param frontPage
* @return
*/
IPage<InspectionProject> selectPage(FrontPage<InspectionProject> frontPage, InspectionProject inspectionProject);
List<InspectionProject> selectList(InspectionProject inspectionProject);
String InspectProjectNoGenerationRules(InspectionProject inspectionProject);
String findRevisionByCurrentRevision(String inspectProjectNo);
}

@ -8,6 +8,7 @@ import com.foreverwin.modular.core.util.FrontPage;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -31,4 +32,6 @@ public interface SelfReportService extends IService<SelfReport> {
Object reject(String handle);
List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime);
void doAdd(Map<String, Object> map);
}

@ -1,46 +0,0 @@
package com.foreverwin.mesnac.quality.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.InspectionProjectDetail;
import com.foreverwin.mesnac.quality.mapper.InspectionProjectDetailMapper;
import com.foreverwin.mesnac.quality.service.InspectionProjectDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectionProjectDetailServiceImpl extends ServiceImpl<InspectionProjectDetailMapper, InspectionProjectDetail> implements InspectionProjectDetailService {
@Autowired
private InspectionProjectDetailMapper inspectionProjectDetailMapper;
@Override
public IPage<InspectionProjectDetail> selectPage(FrontPage<InspectionProjectDetail> frontPage, InspectionProjectDetail inspectionProjectDetail) {
QueryWrapper<InspectionProjectDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProjectDetail);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InspectionProjectDetail> selectList(InspectionProjectDetail inspectionProjectDetail) {
QueryWrapper<InspectionProjectDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProjectDetail);
return super.list(queryWrapper);
}
}

@ -1,80 +0,0 @@
package com.foreverwin.mesnac.quality.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.quality.mapper.InspectionProjectMapper;
import com.foreverwin.mesnac.quality.model.InspectionProject;
import com.foreverwin.mesnac.quality.service.InspectionProjectService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Robert
* @since 2021-06-03
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectionProjectServiceImpl extends ServiceImpl<InspectionProjectMapper, InspectionProject> implements InspectionProjectService {
@Autowired
private InspectionProjectMapper inspectionProjectMapper;
@Override
public IPage<InspectionProject> selectPage(FrontPage<InspectionProject> frontPage, InspectionProject inspectionProject) {
QueryWrapper<InspectionProject> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProject);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InspectionProject> selectList(InspectionProject inspectionProject) {
QueryWrapper<InspectionProject> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionProject);
return super.list(queryWrapper);
}
@Override
public String InspectProjectNoGenerationRules(InspectionProject inspectionProject) {
if(StringUtil.isEmpty(inspectionProject.getItem())){
inspectionProject.setInspectProjectNo(inspectionProject.getInspectType()+",*"+",*"+",*"+",*");
inspectionProject.setItemBo("*");
inspectionProject.setItem("*");
inspectionProject.setOperation("*");
inspectionProject.setStepId("*");
inspectionProject.setSubStep("*");
}else if(StringUtil.isEmpty(inspectionProject.getOperation())){
inspectionProject.setInspectProjectNo(inspectionProject.getInspectType()+","+inspectionProject.getItem()+",*"+",*"+",*");
inspectionProject.setOperation("*");
inspectionProject.setStepId("*");
inspectionProject.setSubStep("*");
}else if(StringUtil.isEmpty(inspectionProject.getSubStep())){
inspectionProject.setInspectProjectNo(inspectionProject.getInspectType()+","+inspectionProject.getItem()+","
+inspectionProject.getOperation()+","+inspectionProject.getStepId()+",*");
inspectionProject.setSubStep("*");
}else {
inspectionProject.setInspectProjectNo(inspectionProject.getInspectType()+","+inspectionProject.getItem()+","
+inspectionProject.getOperation()+","+inspectionProject.getStepId()+","+inspectionProject.getSubStep());
}
return inspectionProject.getInspectProjectNo();
}
@Override
public String findRevisionByCurrentRevision(String inspectProjectNo) {
String site = CommonMethods.getSite();
return inspectionProjectMapper.findRevisionByCurrentRevision(site,inspectProjectNo);
}
}

@ -1,21 +1,26 @@
package com.foreverwin.mesnac.quality.service.impl;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.quality.mapper.SelfReportMapper;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.visiprise.common.exception.BaseException;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* <p>
*
@ -31,6 +36,8 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
@Autowired
private SelfReportMapper selfReportMapper;
@Autowired
private SfcCrossMapper sfcCorssMapper;
static final String STATE_NEW="NEW";
@ -56,6 +63,20 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
return selfReportMapper.selectList(queryWrapper,locale,startTime,endTime);
}
@Override
public void doAdd(Map<String, Object> map) {
String site = CommonMethods.getSite();
String sfc = (String)map.get("sfc");
String resrce = (String)map.get("resrce");
List list = (List)map.get("ncList");
SfcDto sfcDto = new SfcDto();
sfcDto.setSfc(sfc);
sfcDto.setResrce(resrce);
Map<String, Object> sfcMapper = sfcCorssMapper.querySfcData(site, LocaleContextHolder.getLocale().getLanguage(), sfcDto);
}
@Override
public Object reject(String handle) {
SelfReport selfReport = getById(handle);

@ -1,562 +0,0 @@
<?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.foreverwin.mesnac.quality.mapper.InspectionProjectDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.quality.model.InspectionProjectDetail">
<id column="HANDLE" property="handle" />
<result column="INSPECT_PROJECT_BO" property="inspectProjectBo" />
<result column="SEQ" property="seq" />
<result column="PARAM_NO" property="paramNo" />
<result column="DESCRIPTION" property="description" />
<result column="INSPECT_METHOD" property="inspectMethod" />
<result column="PARAM_TYPE" property="paramType" />
<result column="PARAM_UNIT" property="paramUnit" />
<result column="DECIMAL_NUM" property="decimalNum" />
<result column="MIN_VALUE" property="minValue" />
<result column="STANDARD_VALUE" property="standardValue" />
<result column="MAX_VALUE" property="maxValue" />
<result column="FALSE_VALUE" property="falseValue" />
<result column="TRUE_VALUE" property="trueValue" />
<result column="IS_REQUIRED" property="isRequired" />
<result column="CHECK_NUM" property="checkNum" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, INSPECT_PROJECT_BO, SEQ, PARAM_NO, DESCRIPTION, INSPECT_METHOD, PARAM_TYPE, PARAM_UNIT, DECIMAL_NUM, MIN_VALUE, STANDARD_VALUE, MAX_VALUE, FALSE_VALUE, TRUE_VALUE, IS_REQUIRED, CHECK_NUM, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_PROJECT_DETAIL WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_PROJECT_DETAIL
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_PROJECT_DETAIL WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.quality.model.InspectionProjectDetail">
INSERT INTO Z_INSPECTION_PROJECT_DETAIL
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="inspectProjectBo!=null">INSPECT_PROJECT_BO,</if>
<if test="seq!=null">SEQ,</if>
<if test="paramNo!=null">PARAM_NO,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="inspectMethod!=null">INSPECT_METHOD,</if>
<if test="paramType!=null">PARAM_TYPE,</if>
<if test="paramUnit!=null">PARAM_UNIT,</if>
<if test="decimalNum!=null">DECIMAL_NUM,</if>
<if test="minValue!=null">MIN_VALUE,</if>
<if test="standardValue!=null">STANDARD_VALUE,</if>
<if test="maxValue!=null">MAX_VALUE,</if>
<if test="falseValue!=null">FALSE_VALUE,</if>
<if test="trueValue!=null">TRUE_VALUE,</if>
<if test="isRequired!=null">IS_REQUIRED,</if>
<if test="checkNum!=null">CHECK_NUM,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="inspectProjectBo!=null">#{inspectProjectBo},</if>
<if test="seq!=null">#{seq},</if>
<if test="paramNo!=null">#{paramNo},</if>
<if test="description!=null">#{description},</if>
<if test="inspectMethod!=null">#{inspectMethod},</if>
<if test="paramType!=null">#{paramType},</if>
<if test="paramUnit!=null">#{paramUnit},</if>
<if test="decimalNum!=null">#{decimalNum},</if>
<if test="minValue!=null">#{minValue},</if>
<if test="standardValue!=null">#{standardValue},</if>
<if test="maxValue!=null">#{maxValue},</if>
<if test="falseValue!=null">#{falseValue},</if>
<if test="trueValue!=null">#{trueValue},</if>
<if test="isRequired!=null">#{isRequired},</if>
<if test="checkNum!=null">#{checkNum},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.quality.model.InspectionProjectDetail">
INSERT INTO Z_INSPECTION_PROJECT_DETAIL
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{inspectProjectBo},
#{seq},
#{paramNo},
#{description},
#{inspectMethod},
#{paramType},
#{paramUnit},
#{decimalNum},
#{minValue},
#{standardValue},
#{maxValue},
#{falseValue},
#{trueValue},
#{isRequired},
#{checkNum},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_INSPECTION_PROJECT_DETAIL <trim prefix="SET" suffixOverrides=",">
<if test="et.inspectProjectBo!=null">INSPECT_PROJECT_BO=#{et.inspectProjectBo},</if>
<if test="et.seq!=null">SEQ=#{et.seq},</if>
<if test="et.paramNo!=null">PARAM_NO=#{et.paramNo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.inspectMethod!=null">INSPECT_METHOD=#{et.inspectMethod},</if>
<if test="et.paramType!=null">PARAM_TYPE=#{et.paramType},</if>
<if test="et.paramUnit!=null">PARAM_UNIT=#{et.paramUnit},</if>
<if test="et.decimalNum!=null">DECIMAL_NUM=#{et.decimalNum},</if>
<if test="et.minValue!=null">MIN_VALUE=#{et.minValue},</if>
<if test="et.standardValue!=null">STANDARD_VALUE=#{et.standardValue},</if>
<if test="et.maxValue!=null">MAX_VALUE=#{et.maxValue},</if>
<if test="et.falseValue!=null">FALSE_VALUE=#{et.falseValue},</if>
<if test="et.trueValue!=null">TRUE_VALUE=#{et.trueValue},</if>
<if test="et.isRequired!=null">IS_REQUIRED=#{et.isRequired},</if>
<if test="et.checkNum!=null">CHECK_NUM=#{et.checkNum},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_INSPECTION_PROJECT_DETAIL <trim prefix="SET" suffixOverrides=",">
INSPECT_PROJECT_BO=#{et.inspectProjectBo},
SEQ=#{et.seq},
PARAM_NO=#{et.paramNo},
DESCRIPTION=#{et.description},
INSPECT_METHOD=#{et.inspectMethod},
PARAM_TYPE=#{et.paramType},
PARAM_UNIT=#{et.paramUnit},
DECIMAL_NUM=#{et.decimalNum},
MIN_VALUE=#{et.minValue},
STANDARD_VALUE=#{et.standardValue},
MAX_VALUE=#{et.maxValue},
FALSE_VALUE=#{et.falseValue},
TRUE_VALUE=#{et.trueValue},
IS_REQUIRED=#{et.isRequired},
CHECK_NUM=#{et.checkNum},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_INSPECTION_PROJECT_DETAIL <trim prefix="SET" suffixOverrides=",">
<if test="et.inspectProjectBo!=null">INSPECT_PROJECT_BO=#{et.inspectProjectBo},</if>
<if test="et.seq!=null">SEQ=#{et.seq},</if>
<if test="et.paramNo!=null">PARAM_NO=#{et.paramNo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.inspectMethod!=null">INSPECT_METHOD=#{et.inspectMethod},</if>
<if test="et.paramType!=null">PARAM_TYPE=#{et.paramType},</if>
<if test="et.paramUnit!=null">PARAM_UNIT=#{et.paramUnit},</if>
<if test="et.decimalNum!=null">DECIMAL_NUM=#{et.decimalNum},</if>
<if test="et.minValue!=null">MIN_VALUE=#{et.minValue},</if>
<if test="et.standardValue!=null">STANDARD_VALUE=#{et.standardValue},</if>
<if test="et.maxValue!=null">MAX_VALUE=#{et.maxValue},</if>
<if test="et.falseValue!=null">FALSE_VALUE=#{et.falseValue},</if>
<if test="et.trueValue!=null">TRUE_VALUE=#{et.trueValue},</if>
<if test="et.isRequired!=null">IS_REQUIRED=#{et.isRequired},</if>
<if test="et.checkNum!=null">CHECK_NUM=#{et.checkNum},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_INSPECTION_PROJECT_DETAIL WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_INSPECTION_PROJECT_DETAIL
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_INSPECTION_PROJECT_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inspectProjectBo!=null"> AND INSPECT_PROJECT_BO=#{ew.entity.inspectProjectBo}</if>
<if test="ew.entity.seq!=null"> AND SEQ=#{ew.entity.seq}</if>
<if test="ew.entity.paramNo!=null"> AND PARAM_NO=#{ew.entity.paramNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.inspectMethod!=null"> AND INSPECT_METHOD=#{ew.entity.inspectMethod}</if>
<if test="ew.entity.paramType!=null"> AND PARAM_TYPE=#{ew.entity.paramType}</if>
<if test="ew.entity.paramUnit!=null"> AND PARAM_UNIT=#{ew.entity.paramUnit}</if>
<if test="ew.entity.decimalNum!=null"> AND DECIMAL_NUM=#{ew.entity.decimalNum}</if>
<if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
<if test="ew.entity.standardValue!=null"> AND STANDARD_VALUE=#{ew.entity.standardValue}</if>
<if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
<if test="ew.entity.falseValue!=null"> AND FALSE_VALUE=#{ew.entity.falseValue}</if>
<if test="ew.entity.trueValue!=null"> AND TRUE_VALUE=#{ew.entity.trueValue}</if>
<if test="ew.entity.isRequired!=null"> AND IS_REQUIRED=#{ew.entity.isRequired}</if>
<if test="ew.entity.checkNum!=null"> AND CHECK_NUM=#{ew.entity.checkNum}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_INSPECTION_PROJECT_DETAIL WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -1,520 +0,0 @@
<?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.foreverwin.mesnac.quality.mapper.InspectionProjectMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.quality.model.InspectionProject">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="INSPECT_PROJECT_NO" property="inspectProjectNo" />
<result column="INSPECT_TYPE" property="inspectType" />
<result column="REVISION" property="revision" />
<result column="CURRENT_REVISION" property="currentRevision" />
<result column="DESCRIPTION" property="description" />
<result column="STATUS" property="status" />
<result column="ITEM_BO" property="itemBo" />
<result column="ITEM" property="item" />
<result column="OPERATION" property="operation" />
<result column="STEP_ID" property="stepId" />
<result column="SUB_STEP" property="subStep" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, INSPECT_PROJECT_NO, INSPECT_TYPE, REVISION, CURRENT_REVISION, DESCRIPTION, STATUS, ITEM_BO, ITEM, OPERATION, STEP_ID, SUB_STEP, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_PROJECT WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_PROJECT
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_PROJECT WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.quality.model.InspectionProject">
INSERT INTO Z_INSPECTION_PROJECT
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="inspectProjectNo!=null">INSPECT_PROJECT_NO,</if>
<if test="inspectType!=null">INSPECT_TYPE,</if>
<if test="revision!=null">REVISION,</if>
<if test="currentRevision!=null">CURRENT_REVISION,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="status!=null">STATUS,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="item!=null">ITEM,</if>
<if test="operation!=null">OPERATION,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="subStep!=null">SUB_STEP,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="inspectProjectNo!=null">#{inspectProjectNo},</if>
<if test="inspectType!=null">#{inspectType},</if>
<if test="revision!=null">#{revision},</if>
<if test="currentRevision!=null">#{currentRevision},</if>
<if test="description!=null">#{description},</if>
<if test="status!=null">#{status},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="item!=null">#{item},</if>
<if test="operation!=null">#{operation},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="subStep!=null">#{subStep},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.quality.model.InspectionProject">
INSERT INTO Z_INSPECTION_PROJECT
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{inspectProjectNo},
#{inspectType},
#{revision},
#{currentRevision},
#{description},
#{status},
#{itemBo},
#{item},
#{operation},
#{stepId},
#{subStep},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_INSPECTION_PROJECT <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inspectProjectNo!=null">INSPECT_PROJECT_NO=#{et.inspectProjectNo},</if>
<if test="et.inspectType!=null">INSPECT_TYPE=#{et.inspectType},</if>
<if test="et.revision!=null">REVISION=#{et.revision},</if>
<if test="et.currentRevision!=null">CURRENT_REVISION=#{et.currentRevision},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.subStep!=null">SUB_STEP=#{et.subStep},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_INSPECTION_PROJECT <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
INSPECT_PROJECT_NO=#{et.inspectProjectNo},
INSPECT_TYPE=#{et.inspectType},
REVISION=#{et.revision},
CURRENT_REVISION=#{et.currentRevision},
DESCRIPTION=#{et.description},
STATUS=#{et.status},
ITEM_BO=#{et.itemBo},
ITEM=#{et.item},
OPERATION=#{et.operation},
STEP_ID=#{et.stepId},
SUB_STEP=#{et.subStep},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_INSPECTION_PROJECT <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inspectProjectNo!=null">INSPECT_PROJECT_NO=#{et.inspectProjectNo},</if>
<if test="et.inspectType!=null">INSPECT_TYPE=#{et.inspectType},</if>
<if test="et.revision!=null">REVISION=#{et.revision},</if>
<if test="et.currentRevision!=null">CURRENT_REVISION=#{et.currentRevision},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.subStep!=null">SUB_STEP=#{et.subStep},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_INSPECTION_PROJECT WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_INSPECTION_PROJECT
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_INSPECTION_PROJECT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inspectProjectNo!=null"> AND INSPECT_PROJECT_NO=#{ew.entity.inspectProjectNo}</if>
<if test="ew.entity.inspectType!=null"> AND INSPECT_TYPE=#{ew.entity.inspectType}</if>
<if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
<if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.subStep!=null"> AND SUB_STEP=#{ew.entity.subStep}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_INSPECTION_PROJECT WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findRevisionByCurrentRevision" resultType="java.lang.String">
SELECT REVISION
FROM Z_INSPECTION_PROJECT
WHERE CURRENT_REVISION = 'true' AND INSPECT_PROJECT_NO = #{inspectProjectNo}
AND SITE = #{site}
</select>
</mapper>
Loading…
Cancel
Save