Merge remote-tracking branch 'origin/master'
commit
638c30b210
@ -0,0 +1,130 @@
|
||||
package com.foreverwin.mesnac.anomaly.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.anomaly.service.AbnormalPlanService;
|
||||
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zjw
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-ABNORMAL-PLAN")
|
||||
public class AbnormalPlanController {
|
||||
|
||||
@Autowired
|
||||
public AbnormalPlanService abnormalPlanService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getAbnormalPlanById(@PathVariable String id) {
|
||||
return R.ok( abnormalPlanService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getAbnormalPlanList(AbnormalPlan abnormalPlan){
|
||||
List<AbnormalPlan> result;
|
||||
QueryWrapper<AbnormalPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(abnormalPlan);
|
||||
result = abnormalPlanService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<AbnormalPlan> frontPage, AbnormalPlan abnormalPlan){
|
||||
IPage result;
|
||||
QueryWrapper<AbnormalPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(abnormalPlan);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(AbnormalPlan::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getAbnormalBillBo, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getStatus, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getWorkCenter, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getAbnormalMethod, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getShopOrder, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getResrce, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getItemBo, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getProcessor, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getClosedUser, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getCreatedUser, frontPage.getGlobalQuery())
|
||||
.or().like(AbnormalPlan::getModifiedUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = abnormalPlanService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param abnormalPlan 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody AbnormalPlan abnormalPlan) {
|
||||
return R.ok(abnormalPlanService.save(abnormalPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param abnormalPlan 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody AbnormalPlan abnormalPlan) {
|
||||
return R.ok(abnormalPlanService.updateById(abnormalPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(abnormalPlanService.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(abnormalPlanService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.anomaly.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zjw
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@Repository
|
||||
public interface AbnormalPlanMapper extends BaseMapper<AbnormalPlan> {
|
||||
|
||||
}
|
@ -0,0 +1,329 @@
|
||||
package com.foreverwin.mesnac.anomaly.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 zjw
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
|
||||
@TableName("Z_ABNORMAL_PLAN")
|
||||
|
||||
public class AbnormalPlan extends Model<AbnormalPlan> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 异常单号
|
||||
*/
|
||||
@TableField("ABNORMAL_BILL_BO")
|
||||
private String abnormalBillBo;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("STATUS")
|
||||
private String status;
|
||||
/**
|
||||
* 车间
|
||||
*/
|
||||
@TableField("WORK_CENTER")
|
||||
private String workCenter;
|
||||
/**
|
||||
* 异常方案
|
||||
*/
|
||||
@TableField("ABNORMAL_METHOD")
|
||||
private String abnormalMethod;
|
||||
/**
|
||||
* 工单
|
||||
*/
|
||||
@TableField("SHOP_ORDER")
|
||||
private String shopOrder;
|
||||
/**
|
||||
* 设备
|
||||
*/
|
||||
@TableField("RESRCE")
|
||||
private String resrce;
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@TableField("ITEM_BO")
|
||||
private String itemBo;
|
||||
/**
|
||||
* 异常数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private Long qty;
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
@TableField("PROCESSOR")
|
||||
private String processor;
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@TableField("PROCESS_DATE_TIME")
|
||||
private LocalDateTime processDateTime;
|
||||
/**
|
||||
* 闭环人员
|
||||
*/
|
||||
@TableField("CLOSED_USER")
|
||||
private String closedUser;
|
||||
/**
|
||||
* 闭环时间
|
||||
*/
|
||||
@TableField("CLOSED_DATE_TIME")
|
||||
private LocalDateTime closedDateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATED_USER")
|
||||
private String createdUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField("MODIFIED_USER")
|
||||
private String modifiedUser;
|
||||
/**
|
||||
* 修改日期
|
||||
*/
|
||||
@TableField("MODIFIED_DATE_TIME")
|
||||
private LocalDateTime modifiedDateTime;
|
||||
|
||||
|
||||
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 getAbnormalBillBo() {
|
||||
return abnormalBillBo;
|
||||
}
|
||||
|
||||
public void setAbnormalBillBo(String abnormalBillBo) {
|
||||
this.abnormalBillBo = abnormalBillBo;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getWorkCenter() {
|
||||
return workCenter;
|
||||
}
|
||||
|
||||
public void setWorkCenter(String workCenter) {
|
||||
this.workCenter = workCenter;
|
||||
}
|
||||
|
||||
public String getAbnormalMethod() {
|
||||
return abnormalMethod;
|
||||
}
|
||||
|
||||
public void setAbnormalMethod(String abnormalMethod) {
|
||||
this.abnormalMethod = abnormalMethod;
|
||||
}
|
||||
|
||||
public String getShopOrder() {
|
||||
return shopOrder;
|
||||
}
|
||||
|
||||
public void setShopOrder(String shopOrder) {
|
||||
this.shopOrder = shopOrder;
|
||||
}
|
||||
|
||||
public String getResrce() {
|
||||
return resrce;
|
||||
}
|
||||
|
||||
public void setResrce(String resrce) {
|
||||
this.resrce = resrce;
|
||||
}
|
||||
|
||||
public String getItemBo() {
|
||||
return itemBo;
|
||||
}
|
||||
|
||||
public void setItemBo(String itemBo) {
|
||||
this.itemBo = itemBo;
|
||||
}
|
||||
|
||||
public Long getQty() {
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setQty(Long qty) {
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public LocalDateTime getProcessDateTime() {
|
||||
return processDateTime;
|
||||
}
|
||||
|
||||
public void setProcessDateTime(LocalDateTime processDateTime) {
|
||||
this.processDateTime = processDateTime;
|
||||
}
|
||||
|
||||
public String getClosedUser() {
|
||||
return closedUser;
|
||||
}
|
||||
|
||||
public void setClosedUser(String closedUser) {
|
||||
this.closedUser = closedUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getClosedDateTime() {
|
||||
return closedDateTime;
|
||||
}
|
||||
|
||||
public void setClosedDateTime(LocalDateTime closedDateTime) {
|
||||
this.closedDateTime = closedDateTime;
|
||||
}
|
||||
|
||||
public String getCreatedUser() {
|
||||
return createdUser;
|
||||
}
|
||||
|
||||
public void setCreatedUser(String createdUser) {
|
||||
this.createdUser = createdUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public String getModifiedUser() {
|
||||
return modifiedUser;
|
||||
}
|
||||
|
||||
public void setModifiedUser(String modifiedUser) {
|
||||
this.modifiedUser = modifiedUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getModifiedDateTime() {
|
||||
return modifiedDateTime;
|
||||
}
|
||||
|
||||
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
|
||||
this.modifiedDateTime = modifiedDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String ABNORMAL_BILL_BO = "ABNORMAL_BILL_BO";
|
||||
|
||||
public static final String STATUS = "STATUS";
|
||||
|
||||
public static final String WORK_CENTER = "WORK_CENTER";
|
||||
|
||||
public static final String ABNORMAL_METHOD = "ABNORMAL_METHOD";
|
||||
|
||||
public static final String SHOP_ORDER = "SHOP_ORDER";
|
||||
|
||||
public static final String RESRCE = "RESRCE";
|
||||
|
||||
public static final String ITEM_BO = "ITEM_BO";
|
||||
|
||||
public static final String QTY = "QTY";
|
||||
|
||||
public static final String PROCESSOR = "PROCESSOR";
|
||||
|
||||
public static final String PROCESS_DATE_TIME = "PROCESS_DATE_TIME";
|
||||
|
||||
public static final String CLOSED_USER = "CLOSED_USER";
|
||||
|
||||
public static final String CLOSED_DATE_TIME = "CLOSED_DATE_TIME";
|
||||
|
||||
public static final String CREATED_USER = "CREATED_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFIED_USER = "MODIFIED_USER";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AbnormalPlan{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", abnormalBillBo = " + abnormalBillBo +
|
||||
", status = " + status +
|
||||
", workCenter = " + workCenter +
|
||||
", abnormalMethod = " + abnormalMethod +
|
||||
", shopOrder = " + shopOrder +
|
||||
", resrce = " + resrce +
|
||||
", itemBo = " + itemBo +
|
||||
", qty = " + qty +
|
||||
", processor = " + processor +
|
||||
", processDateTime = " + processDateTime +
|
||||
", closedUser = " + closedUser +
|
||||
", closedDateTime = " + closedDateTime +
|
||||
", createdUser = " + createdUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifiedUser = " + modifiedUser +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.foreverwin.mesnac.anomaly.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
|
||||
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zjw
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
public interface AbnormalPlanService extends IService<AbnormalPlan> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<AbnormalPlan> selectPage(FrontPage<AbnormalPlan> frontPage, AbnormalPlan abnormalPlan);
|
||||
|
||||
List<AbnormalPlan> selectList(AbnormalPlan abnormalPlan);
|
||||
|
||||
void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto, LocalDateTime now);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.foreverwin.mesnac.anomaly.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.anomaly.dto.AbnormalBillDisposeDto;
|
||||
import com.foreverwin.mesnac.anomaly.mapper.AbnormalPlanMapper;
|
||||
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
|
||||
import com.foreverwin.mesnac.anomaly.service.AbnormalPlanService;
|
||||
import com.foreverwin.mesnac.common.constant.Constants;
|
||||
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||
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.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zjw
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, AbnormalPlan> implements AbnormalPlanService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private AbnormalPlanMapper abnormalPlanMapper;
|
||||
|
||||
@Override
|
||||
public IPage<AbnormalPlan> selectPage(FrontPage<AbnormalPlan> frontPage, AbnormalPlan abnormalPlan) {
|
||||
QueryWrapper<AbnormalPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(abnormalPlan);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AbnormalPlan> selectList(AbnormalPlan abnormalPlan) {
|
||||
QueryWrapper<AbnormalPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(abnormalPlan);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAbnormalPlan(AbnormalBillDisposeDto abnormalBillDisposeDto,LocalDateTime now) {
|
||||
String site = CommonMethods.getSite();
|
||||
AbnormalPlan abnormalPlan = new AbnormalPlan();
|
||||
String user = CommonMethods.getUser();
|
||||
//设置主键
|
||||
abnormalPlan.setHandle(HandleEnum.ABNORMAL_PLAN.getHandle(site,abnormalBillDisposeDto.getAbnormalNo()));
|
||||
abnormalPlan.setSite(site);
|
||||
abnormalPlan.setAbnormalBillBo(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBillDisposeDto.getAbnormalNo()));
|
||||
abnormalPlan.setStatus(Constants.UNTREATED);//未处理
|
||||
abnormalPlan.setWorkCenter(abnormalBillDisposeDto.getWorkCenter());
|
||||
abnormalPlan.setAbnormalMethod(abnormalBillDisposeDto.getAbnormalMethod());
|
||||
abnormalPlan.setShopOrder(abnormalBillDisposeDto.getShopOrder());
|
||||
abnormalPlan.setResrce(abnormalBillDisposeDto.getResrce());
|
||||
abnormalPlan.setItemBo(abnormalBillDisposeDto.getItemBo());
|
||||
abnormalPlan.setQty(Long.parseLong(abnormalBillDisposeDto.getNcQty()));
|
||||
//没有处理人和处理时间
|
||||
// abnormalPlan.setProcessor();
|
||||
abnormalPlan.setClosedUser(user);
|
||||
abnormalPlan.setClosedDateTime(now);
|
||||
abnormalPlan.setCreatedUser(user);
|
||||
abnormalPlan.setCreatedDateTime(now);
|
||||
abnormalPlan.setModifiedUser(user);
|
||||
abnormalPlan.setModifiedDateTime(now);
|
||||
this.saveOrUpdate(abnormalPlan);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,530 @@
|
||||
<?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.anomaly.mapper.AbnormalPlanMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.AbnormalPlan">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="ABNORMAL_BILL_BO" property="abnormalBillBo" />
|
||||
<result column="STATUS" property="status" />
|
||||
<result column="WORK_CENTER" property="workCenter" />
|
||||
<result column="ABNORMAL_METHOD" property="abnormalMethod" />
|
||||
<result column="SHOP_ORDER" property="shopOrder" />
|
||||
<result column="RESRCE" property="resrce" />
|
||||
<result column="ITEM_BO" property="itemBo" />
|
||||
<result column="QTY" property="qty" />
|
||||
<result column="PROCESSOR" property="processor" />
|
||||
<result column="PROCESS_DATE_TIME" property="processDateTime" />
|
||||
<result column="CLOSED_USER" property="closedUser" />
|
||||
<result column="CLOSED_DATE_TIME" property="closedDateTime" />
|
||||
<result column="CREATED_USER" property="createdUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFIED_USER" property="modifiedUser" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, ABNORMAL_BILL_BO, STATUS, WORK_CENTER, ABNORMAL_METHOD, SHOP_ORDER, RESRCE, ITEM_BO, QTY, PROCESSOR, PROCESS_DATE_TIME, CLOSED_USER, CLOSED_DATE_TIME, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_PLAN WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_ABNORMAL_PLAN
|
||||
<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_ABNORMAL_PLAN 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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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.anomaly.model.AbnormalPlan">
|
||||
INSERT INTO Z_ABNORMAL_PLAN
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="abnormalBillBo!=null">ABNORMAL_BILL_BO,</if>
|
||||
<if test="status!=null">STATUS,</if>
|
||||
<if test="workCenter!=null">WORK_CENTER,</if>
|
||||
<if test="abnormalMethod!=null">ABNORMAL_METHOD,</if>
|
||||
<if test="shopOrder!=null">SHOP_ORDER,</if>
|
||||
<if test="resrce!=null">RESRCE,</if>
|
||||
<if test="itemBo!=null">ITEM_BO,</if>
|
||||
<if test="qty!=null">QTY,</if>
|
||||
<if test="processor!=null">PROCESSOR,</if>
|
||||
<if test="processDateTime!=null">PROCESS_DATE_TIME,</if>
|
||||
<if test="closedUser!=null">CLOSED_USER,</if>
|
||||
<if test="closedDateTime!=null">CLOSED_DATE_TIME,</if>
|
||||
<if test="createdUser!=null">CREATED_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifiedUser!=null">MODIFIED_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="abnormalBillBo!=null">#{abnormalBillBo},</if>
|
||||
<if test="status!=null">#{status},</if>
|
||||
<if test="workCenter!=null">#{workCenter},</if>
|
||||
<if test="abnormalMethod!=null">#{abnormalMethod},</if>
|
||||
<if test="shopOrder!=null">#{shopOrder},</if>
|
||||
<if test="resrce!=null">#{resrce},</if>
|
||||
<if test="itemBo!=null">#{itemBo},</if>
|
||||
<if test="qty!=null">#{qty},</if>
|
||||
<if test="processor!=null">#{processor},</if>
|
||||
<if test="processDateTime!=null">#{processDateTime},</if>
|
||||
<if test="closedUser!=null">#{closedUser},</if>
|
||||
<if test="closedDateTime!=null">#{closedDateTime},</if>
|
||||
<if test="createdUser!=null">#{createdUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifiedUser!=null">#{modifiedUser},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalPlan">
|
||||
INSERT INTO Z_ABNORMAL_PLAN
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{abnormalBillBo},
|
||||
#{status},
|
||||
#{workCenter},
|
||||
#{abnormalMethod},
|
||||
#{shopOrder},
|
||||
#{resrce},
|
||||
#{itemBo},
|
||||
#{qty},
|
||||
#{processor},
|
||||
#{processDateTime},
|
||||
#{closedUser},
|
||||
#{closedDateTime},
|
||||
#{createdUser},
|
||||
#{createdDateTime},
|
||||
#{modifiedUser},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.abnormalMethod!=null">ABNORMAL_METHOD=#{et.abnormalMethod},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
|
||||
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.processor!=null">PROCESSOR=#{et.processor},</if>
|
||||
<if test="et.processDateTime!=null">PROCESS_DATE_TIME=#{et.processDateTime},</if>
|
||||
<if test="et.closedUser!=null">CLOSED_USER=#{et.closedUser},</if>
|
||||
<if test="et.closedDateTime!=null">CLOSED_DATE_TIME=#{et.closedDateTime},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</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_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
ABNORMAL_BILL_BO=#{et.abnormalBillBo},
|
||||
STATUS=#{et.status},
|
||||
WORK_CENTER=#{et.workCenter},
|
||||
ABNORMAL_METHOD=#{et.abnormalMethod},
|
||||
SHOP_ORDER=#{et.shopOrder},
|
||||
RESRCE=#{et.resrce},
|
||||
ITEM_BO=#{et.itemBo},
|
||||
QTY=#{et.qty},
|
||||
PROCESSOR=#{et.processor},
|
||||
PROCESS_DATE_TIME=#{et.processDateTime},
|
||||
CLOSED_USER=#{et.closedUser},
|
||||
CLOSED_DATE_TIME=#{et.closedDateTime},
|
||||
CREATED_USER=#{et.createdUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
MODIFIED_USER=#{et.modifiedUser},
|
||||
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_ABNORMAL_PLAN <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.abnormalMethod!=null">ABNORMAL_METHOD=#{et.abnormalMethod},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
|
||||
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.processor!=null">PROCESSOR=#{et.processor},</if>
|
||||
<if test="et.processDateTime!=null">PROCESS_DATE_TIME=#{et.processDateTime},</if>
|
||||
<if test="et.closedUser!=null">CLOSED_USER=#{et.closedUser},</if>
|
||||
<if test="et.closedDateTime!=null">CLOSED_DATE_TIME=#{et.closedDateTime},</if>
|
||||
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_ABNORMAL_PLAN
|
||||
<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_ABNORMAL_PLAN
|
||||
<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.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.abnormalMethod!=null"> AND ABNORMAL_METHOD=#{ew.entity.abnormalMethod}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.processor!=null"> AND PROCESSOR=#{ew.entity.processor}</if>
|
||||
<if test="ew.entity.processDateTime!=null"> AND PROCESS_DATE_TIME=#{ew.entity.processDateTime}</if>
|
||||
<if test="ew.entity.closedUser!=null"> AND CLOSED_USER=#{ew.entity.closedUser}</if>
|
||||
<if test="ew.entity.closedDateTime!=null"> AND CLOSED_DATE_TIME=#{ew.entity.closedDateTime}</if>
|
||||
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</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_ABNORMAL_PLAN WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,120 @@
|
||||
package com.foreverwin.mesnac.meapi.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.meapi.service.MessageTypeUserGroupService;
|
||||
import com.foreverwin.mesnac.meapi.model.MessageTypeUserGroup;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/MESSAGE-TYPE-USER-GROUP")
|
||||
public class MessageTypeUserGroupController {
|
||||
|
||||
@Autowired
|
||||
public MessageTypeUserGroupService messageTypeUserGroupService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getMessageTypeUserGroupById(@PathVariable String id) {
|
||||
return R.ok( messageTypeUserGroupService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getMessageTypeUserGroupList(MessageTypeUserGroup messageTypeUserGroup){
|
||||
List<MessageTypeUserGroup> result;
|
||||
QueryWrapper<MessageTypeUserGroup> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(messageTypeUserGroup);
|
||||
result = messageTypeUserGroupService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<MessageTypeUserGroup> frontPage, MessageTypeUserGroup messageTypeUserGroup){
|
||||
IPage result;
|
||||
QueryWrapper<MessageTypeUserGroup> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(messageTypeUserGroup);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(MessageTypeUserGroup::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(MessageTypeUserGroup::getMessageTypeBo, frontPage.getGlobalQuery())
|
||||
.or().like(MessageTypeUserGroup::getUserGroupBo, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = messageTypeUserGroupService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param messageTypeUserGroup 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody MessageTypeUserGroup messageTypeUserGroup) {
|
||||
return R.ok(messageTypeUserGroupService.save(messageTypeUserGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param messageTypeUserGroup 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody MessageTypeUserGroup messageTypeUserGroup) {
|
||||
return R.ok(messageTypeUserGroupService.updateById(messageTypeUserGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(messageTypeUserGroupService.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(messageTypeUserGroupService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.meapi.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.model.MessageTypeUserGroup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@Repository
|
||||
public interface MessageTypeUserGroupMapper extends BaseMapper<MessageTypeUserGroup> {
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.foreverwin.mesnac.meapi.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
|
||||
@TableName("MESSAGE_TYPE_USER_GROUP")
|
||||
|
||||
public class MessageTypeUserGroup extends Model<MessageTypeUserGroup> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("HANDLE")
|
||||
private String handle;
|
||||
@TableField("MESSAGE_TYPE_BO")
|
||||
private String messageTypeBo;
|
||||
@TableField("USER_GROUP_BO")
|
||||
private String userGroupBo;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getMessageTypeBo() {
|
||||
return messageTypeBo;
|
||||
}
|
||||
|
||||
public void setMessageTypeBo(String messageTypeBo) {
|
||||
this.messageTypeBo = messageTypeBo;
|
||||
}
|
||||
|
||||
public String getUserGroupBo() {
|
||||
return userGroupBo;
|
||||
}
|
||||
|
||||
public void setUserGroupBo(String userGroupBo) {
|
||||
this.userGroupBo = userGroupBo;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String MESSAGE_TYPE_BO = "MESSAGE_TYPE_BO";
|
||||
|
||||
public static final String USER_GROUP_BO = "USER_GROUP_BO";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MessageTypeUserGroup{" +
|
||||
"handle = " + handle +
|
||||
", messageTypeBo = " + messageTypeBo +
|
||||
", userGroupBo = " + userGroupBo +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.foreverwin.mesnac.meapi.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.meapi.model.MessageTypeUserGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
public interface MessageTypeUserGroupService extends IService<MessageTypeUserGroup> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<MessageTypeUserGroup> selectPage(FrontPage<MessageTypeUserGroup> frontPage, MessageTypeUserGroup messageTypeUserGroup);
|
||||
|
||||
List<MessageTypeUserGroup> selectList(MessageTypeUserGroup messageTypeUserGroup);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.foreverwin.mesnac.meapi.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.meapi.model.MessageTypeUserGroup;
|
||||
import com.foreverwin.mesnac.meapi.mapper.MessageTypeUserGroupMapper;
|
||||
import com.foreverwin.mesnac.meapi.service.MessageTypeUserGroupService;
|
||||
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 Philip
|
||||
* @since 2021-08-07
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class MessageTypeUserGroupServiceImpl extends ServiceImpl<MessageTypeUserGroupMapper, MessageTypeUserGroup> implements MessageTypeUserGroupService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private MessageTypeUserGroupMapper messageTypeUserGroupMapper;
|
||||
|
||||
@Override
|
||||
public IPage<MessageTypeUserGroup> selectPage(FrontPage<MessageTypeUserGroup> frontPage, MessageTypeUserGroup messageTypeUserGroup) {
|
||||
QueryWrapper<MessageTypeUserGroup> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(messageTypeUserGroup);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageTypeUserGroup> selectList(MessageTypeUserGroup messageTypeUserGroup) {
|
||||
QueryWrapper<MessageTypeUserGroup> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(messageTypeUserGroup);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,262 @@
|
||||
<?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.meapi.mapper.MessageTypeUserGroupMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.MessageTypeUserGroup">
|
||||
<result column="HANDLE" property="handle" />
|
||||
<result column="MESSAGE_TYPE_BO" property="messageTypeBo" />
|
||||
<result column="USER_GROUP_BO" property="userGroupBo" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, MESSAGE_TYPE_BO, USER_GROUP_BO
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM MESSAGE_TYPE_USER_GROUP
|
||||
<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="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM MESSAGE_TYPE_USER_GROUP
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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.meapi.model.MessageTypeUserGroup">
|
||||
INSERT INTO MESSAGE_TYPE_USER_GROUP
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="messageTypeBo!=null">MESSAGE_TYPE_BO,</if>
|
||||
<if test="userGroupBo!=null">USER_GROUP_BO,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="messageTypeBo!=null">#{messageTypeBo},</if>
|
||||
<if test="userGroupBo!=null">#{userGroupBo},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.MessageTypeUserGroup">
|
||||
INSERT INTO MESSAGE_TYPE_USER_GROUP
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{messageTypeBo},
|
||||
#{userGroupBo},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE MESSAGE_TYPE_USER_GROUP <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
|
||||
<if test="et.messageTypeBo!=null">MESSAGE_TYPE_BO=#{et.messageTypeBo},</if>
|
||||
<if test="et.userGroupBo!=null">USER_GROUP_BO=#{et.userGroupBo},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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="deleteByMap">
|
||||
DELETE FROM MESSAGE_TYPE_USER_GROUP
|
||||
<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 MESSAGE_TYPE_USER_GROUP
|
||||
<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.messageTypeBo!=null"> AND MESSAGE_TYPE_BO=#{ew.entity.messageTypeBo}</if>
|
||||
<if test="ew.entity.userGroupBo!=null"> AND USER_GROUP_BO=#{ew.entity.userGroupBo}</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>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,43 @@
|
||||
package com.foreverwin.mesnac.quartz.job;
|
||||
|
||||
import com.foreverwin.mesnac.common.service.ProdReadyTaskService;
|
||||
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||
import com.foreverwin.modular.core.exception.BaseException;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Philip
|
||||
* @Since 2021-08-06
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
public class ProdUnReadySendMsgJob implements Job {
|
||||
private static final String SITE_UPPERCASE = "SITE";
|
||||
private static final String SITE_LOWERCASE = "site";
|
||||
|
||||
@Autowired
|
||||
private ProdReadyTaskService prodReadyTaskService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
//获取站点,若站点为空则抛出异常
|
||||
String site = getSite(context);
|
||||
if (StringUtil.isBlank(site)) {
|
||||
throw new BaseException("anomaly.quartz.task.not.site", null);
|
||||
}
|
||||
|
||||
prodReadyTaskService.sendMsgJob(site);
|
||||
}
|
||||
|
||||
private String getSite(JobExecutionContext context) {
|
||||
String site = context.getJobDetail().getJobDataMap().getString(SITE_LOWERCASE);
|
||||
if (StringUtil.isBlank(site)) {
|
||||
site = context.getJobDetail().getJobDataMap().getString(SITE_UPPERCASE);
|
||||
}
|
||||
return site;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue