feat: 项目组套和三方出入库明细
parent
a20becfb13
commit
2de35f3091
@ -0,0 +1,24 @@
|
|||||||
|
package com.glxp.api.dao.thrsys;
|
||||||
|
|
||||||
|
import com.glxp.api.dao.BaseMapperPlus;
|
||||||
|
import com.glxp.api.dao.inout.IoOrderDetailBizDao;
|
||||||
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
||||||
|
import com.glxp.api.entity.thrsys.ThrInvOrderDetail;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ThrInvOrderDetailMapper extends BaseMapperPlus<ThrInvOrderDetailMapper, ThrInvOrderDetail, ThrInvOrderDetail> {
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(ThrInvOrderDetail record);
|
||||||
|
|
||||||
|
int insertSelective(ThrInvOrderDetail record);
|
||||||
|
|
||||||
|
ThrInvOrderDetail selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(ThrInvOrderDetail record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(ThrInvOrderDetail record);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.glxp.api.dao.thrsys;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.thrsys.ThrInvOrder;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ThrInvOrderMapper {
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(ThrInvOrder record);
|
||||||
|
|
||||||
|
int insertSelective(ThrInvOrder record);
|
||||||
|
|
||||||
|
ThrInvOrder selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(ThrInvOrder record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(ThrInvOrder record);
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package com.glxp.api.entity.thrsys;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存出入库明细
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "thr_inv_order")
|
||||||
|
public class ThrInvOrder implements Serializable {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据号
|
||||||
|
*/
|
||||||
|
private String billNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据时间
|
||||||
|
*/
|
||||||
|
private Date billDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存开始时间
|
||||||
|
*/
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存结束时间
|
||||||
|
*/
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入库类型
|
||||||
|
*/
|
||||||
|
private String mainAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方单据类型
|
||||||
|
*/
|
||||||
|
private String billType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String invCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货位编码
|
||||||
|
*/
|
||||||
|
private String spaceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,156 @@
|
|||||||
|
package com.glxp.api.entity.thrsys;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "thr_inv_order_detail")
|
||||||
|
public class ThrInvOrderDetail implements Serializable {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 单据号
|
||||||
|
*/
|
||||||
|
private String orderIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品通用名称
|
||||||
|
*/
|
||||||
|
private String cpmctymc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资字典主键
|
||||||
|
*/
|
||||||
|
private Long relId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方项目编码/耗材字典
|
||||||
|
*/
|
||||||
|
private String thrCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DI
|
||||||
|
*/
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
private Long batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
private String measname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 价格
|
||||||
|
*/
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失效日期
|
||||||
|
*/
|
||||||
|
private Date expireDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医疗器械注册备案人
|
||||||
|
*/
|
||||||
|
private String ylqxzcrbarmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册/备案号
|
||||||
|
*/
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库数量
|
||||||
|
*/
|
||||||
|
private String inCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库数量
|
||||||
|
*/
|
||||||
|
private String outCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商
|
||||||
|
*/
|
||||||
|
private String supName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编码
|
||||||
|
*/
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库
|
||||||
|
*/
|
||||||
|
private String invName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String invCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货位
|
||||||
|
*/
|
||||||
|
private String spaceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货位编码
|
||||||
|
*/
|
||||||
|
private String spaceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际数量
|
||||||
|
*/
|
||||||
|
private String reCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入库类型
|
||||||
|
*/
|
||||||
|
private String mainAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产企业
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.glxp.api.service.thrsys;
|
||||||
|
|
||||||
|
import com.glxp.api.req.inv.FilterInvProductRequest;
|
||||||
|
|
||||||
|
public interface ThrInvOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询三方系统的出入库明细、进行处理
|
||||||
|
*/
|
||||||
|
public void handleExternalThrInvOrder(FilterInvProductRequest filterInvProductRequest);
|
||||||
|
}
|
@ -0,0 +1,139 @@
|
|||||||
|
package com.glxp.api.service.thrsys.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.constant.Constant;
|
||||||
|
import com.glxp.api.constant.ConstantStatus;
|
||||||
|
import com.glxp.api.constant.ConstantType;
|
||||||
|
import com.glxp.api.dao.thrsys.ThrInvOrderDetailMapper;
|
||||||
|
import com.glxp.api.dao.thrsys.ThrInvOrderMapper;
|
||||||
|
import com.glxp.api.entity.basic.BasicSkProjectDetailEntity;
|
||||||
|
import com.glxp.api.entity.thrsys.ThrInvOrder;
|
||||||
|
import com.glxp.api.entity.thrsys.ThrInvOrderDetail;
|
||||||
|
import com.glxp.api.http.ErpInvClient;
|
||||||
|
import com.glxp.api.req.inv.FilterInvProductRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.res.inv.ThrInvResultResponse;
|
||||||
|
import com.glxp.api.service.basic.impl.BasicDestinyRelService;
|
||||||
|
import com.glxp.api.service.thrsys.ThrInvOrderService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ErpInvClient erpInvClient;
|
||||||
|
@Resource
|
||||||
|
BasicDestinyRelService basicDestinyRelService;
|
||||||
|
@Resource
|
||||||
|
ThrInvOrderMapper thrInvOrderMapper;
|
||||||
|
@Resource
|
||||||
|
ThrInvOrderDetailMapper thrInvOrderDetailMapper;
|
||||||
|
// 设置要输出的日期格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleExternalThrInvOrder(FilterInvProductRequest filterInvProductRequest) {
|
||||||
|
BaseResponse<PageSimpleResponse<ThrInvResultResponse>> baseResponse = erpInvClient.getInvResult(filterInvProductRequest);
|
||||||
|
if (baseResponse.getCode() == 20000) {
|
||||||
|
List<ThrInvResultResponse> list = baseResponse.getData().getList();
|
||||||
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
|
String billNo = generateBillNo(filterInvProductRequest);//单据号
|
||||||
|
//处理 返回实体 转换成 单据 和 单据明细
|
||||||
|
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
|
||||||
|
handleExternalConvertThrInvOrderDetail(list,thrInvOrderDetails,billNo);
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)){
|
||||||
|
ThrInvOrder thrInvOrder = new ThrInvOrder();
|
||||||
|
handleExternalConvertThrInvOrder(billNo,filterInvProductRequest,thrInvOrder,list.get(0));
|
||||||
|
|
||||||
|
//保存数据
|
||||||
|
thrInvOrderMapper.insert(thrInvOrder);
|
||||||
|
thrInvOrderDetailMapper.insertBatch(thrInvOrderDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成单号 SFIO + 6位起始日期 + 6位结束日期 + 6位随机
|
||||||
|
* @param filterInvProductRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String generateBillNo(FilterInvProductRequest filterInvProductRequest) {
|
||||||
|
String startDate = sdf.format(filterInvProductRequest.getStartDate()).substring(2);
|
||||||
|
String endDate = sdf.format(filterInvProductRequest.getEndDate()).substring(2);
|
||||||
|
Integer random = new Random().nextInt(900000) + 100000;
|
||||||
|
return Constant.TRIPARTITE_INV_ORDER + startDate+endDate + random;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将三方的出入库明细列表 转换为 系统的出入库单据
|
||||||
|
* @param filterInvProductRequest
|
||||||
|
* @param thrInvOrder
|
||||||
|
* @param thrInvResultResponse
|
||||||
|
*/
|
||||||
|
private void handleExternalConvertThrInvOrder(String billNo,FilterInvProductRequest filterInvProductRequest,ThrInvOrder thrInvOrder,ThrInvResultResponse thrInvResultResponse) {
|
||||||
|
|
||||||
|
Date newDate = new Date();
|
||||||
|
thrInvOrder.setBillNo(billNo);//单据号
|
||||||
|
thrInvOrder.setBillDate(newDate);//单据时间
|
||||||
|
thrInvOrder.setStartDate(filterInvProductRequest.getStartDate());//库存开始时间
|
||||||
|
thrInvOrder.setEndDate(filterInvProductRequest.getEndDate());//库存结束时间
|
||||||
|
thrInvOrder.setMainAction(thrInvResultResponse.getMainAction());//出入库类型
|
||||||
|
thrInvOrder.setBillType(thrInvResultResponse.getMainAction());//第三方单据类型
|
||||||
|
thrInvOrder.setDeptCode(thrInvResultResponse.getDeptCode());//部门编号
|
||||||
|
thrInvOrder.setInvCode(thrInvResultResponse.getInvCode());//仓库代码
|
||||||
|
thrInvOrder.setSpaceCode(thrInvResultResponse.getSpaceCode());//货位编码
|
||||||
|
thrInvOrder.setStatus(ConstantStatus.SFIO_DRAFT);//单据状态 草稿
|
||||||
|
thrInvOrder.setCreateTime(newDate);
|
||||||
|
thrInvOrder.setCreateUser("系统自动");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将三方的出入库明细列表 转换为 系统的出入库单据明细
|
||||||
|
* @param list
|
||||||
|
* @param thrInvOrderDetails
|
||||||
|
* @param billNo
|
||||||
|
*/
|
||||||
|
private void handleExternalConvertThrInvOrderDetail(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails,String billNo) {
|
||||||
|
list.forEach( item -> {
|
||||||
|
String thrCode = item.getThrCode();
|
||||||
|
String mainAction = item.getMainAction();
|
||||||
|
Integer count = 0;
|
||||||
|
if (ConstantType.TYPE_PUT.equals(mainAction)) {
|
||||||
|
count = Integer.valueOf(item.getInCount());
|
||||||
|
}else {
|
||||||
|
count = Integer.valueOf(item.getOutCount());
|
||||||
|
}
|
||||||
|
//通过thrCode获取到项目组套
|
||||||
|
List<BasicSkProjectDetailEntity> skProjectDetailEntityList= basicDestinyRelService.filterDestinyRelListByPId(thrCode);
|
||||||
|
if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0 ){
|
||||||
|
Integer finalCount = count;
|
||||||
|
skProjectDetailEntityList.forEach(sk -> {
|
||||||
|
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
|
||||||
|
BeanUtils.copyProperties(item,thrInvOrderDetail);
|
||||||
|
thrInvOrderDetail.setOrderIdFk(billNo);
|
||||||
|
thrInvOrderDetail.setRelId(sk.getRelId());
|
||||||
|
Integer skCount = sk.getCount();
|
||||||
|
if (skCount != null && skCount > 0){
|
||||||
|
thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount));
|
||||||
|
thrInvOrderDetails.add(thrInvOrderDetail);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.glxp.api.task;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateRange;
|
||||||
|
import com.glxp.api.dao.schedule.ScheduledDao;
|
||||||
|
import com.glxp.api.entity.system.ScheduledEntity;
|
||||||
|
import com.glxp.api.req.inv.FilterInvProductRequest;
|
||||||
|
import com.glxp.api.req.system.ScheduledRequest;
|
||||||
|
import com.glxp.api.service.thrsys.ThrInvOrderService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.regexp.RE;
|
||||||
|
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
||||||
|
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||||
|
import org.springframework.scheduling.support.CronTrigger;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动抓取第三方出入库明细生成单据
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ThrInvOrderTask implements SchedulingConfigurer {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ScheduledDao scheduledDao;
|
||||||
|
@Resource
|
||||||
|
ThrInvOrderService thrInvOrderService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
||||||
|
scheduledTaskRegistrar.addTriggerTask(this::process, triggerContext -> {
|
||||||
|
ScheduledRequest scheduledRequest = new ScheduledRequest();
|
||||||
|
scheduledRequest.setCronName("thrInvOrderTask");
|
||||||
|
ScheduledEntity scheduled = scheduledDao.findScheduled(scheduledRequest);
|
||||||
|
if (null == scheduled) {
|
||||||
|
log.error("自动抓取第三方出入库明细生成单据定时任务未配置,请注意!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String cron = scheduled.getCron();
|
||||||
|
return new CronTrigger(cron).nextExecutionTime(triggerContext);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void process() {
|
||||||
|
log.info("自动抓取第三方出入库明细生成单据定时任务开始");
|
||||||
|
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
|
||||||
|
String days = getBeginAndEndDateByDays(1);
|
||||||
|
|
||||||
|
filterInvProductRequest.setStartDate(stringToDate(days +" 00:00:00"));
|
||||||
|
filterInvProductRequest.setEndDate(stringToDate(days +" 23:59:59"));
|
||||||
|
thrInvOrderService.handleExternalThrInvOrder(filterInvProductRequest);
|
||||||
|
log.info("自动抓取第三方出入库明细生成单据定时任务结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取距离当前时间日期(n天)的开始时间和结束时间
|
||||||
|
* @param n
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getBeginAndEndDateByDays(int n) {
|
||||||
|
Date date=new Date();//取时间
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(calendar.DATE,-1);//把日期往前减少一天,若想把日期向后推一天则将负数改为正数
|
||||||
|
date=calendar.getTime();
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
return formatter.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date stringToDate(String time) {
|
||||||
|
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Date date = null;
|
||||||
|
try {
|
||||||
|
date = dateformat.parse(time);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,356 @@
|
|||||||
|
<?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.glxp.api.dao.thrsys.ThrInvOrderDetailMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvOrderDetail">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table thr_inv_order_detail-->
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk" />
|
||||||
|
<result column="cpmctymc" jdbcType="VARCHAR" property="cpmctymc" />
|
||||||
|
<result column="relId" jdbcType="INTEGER" property="relId" />
|
||||||
|
<result column="thrCode" jdbcType="VARCHAR" property="thrCode" />
|
||||||
|
<result column="nameCode" jdbcType="VARCHAR" property="nameCode" />
|
||||||
|
<result column="ggxh" jdbcType="VARCHAR" property="ggxh" />
|
||||||
|
<result column="batchNo" jdbcType="INTEGER" property="batchNo" />
|
||||||
|
<result column="measname" jdbcType="VARCHAR" property="measname" />
|
||||||
|
<result column="price" jdbcType="DECIMAL" property="price" />
|
||||||
|
<result column="productionDate" jdbcType="TIMESTAMP" property="productionDate" />
|
||||||
|
<result column="expireDate" jdbcType="TIMESTAMP" property="expireDate" />
|
||||||
|
<result column="ylqxzcrbarmc" jdbcType="VARCHAR" property="ylqxzcrbarmc" />
|
||||||
|
<result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh" />
|
||||||
|
<result column="inCount" jdbcType="VARCHAR" property="inCount" />
|
||||||
|
<result column="outCount" jdbcType="VARCHAR" property="outCount" />
|
||||||
|
<result column="supName" jdbcType="VARCHAR" property="supName" />
|
||||||
|
<result column="deptName" jdbcType="VARCHAR" property="deptName" />
|
||||||
|
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" />
|
||||||
|
<result column="invName" jdbcType="VARCHAR" property="invName" />
|
||||||
|
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
|
||||||
|
<result column="spaceCode" jdbcType="VARCHAR" property="spaceCode" />
|
||||||
|
<result column="spaceName" jdbcType="VARCHAR" property="spaceName" />
|
||||||
|
<result column="reCount" jdbcType="VARCHAR" property="reCount" />
|
||||||
|
<result column="mainAction" jdbcType="VARCHAR" property="mainAction" />
|
||||||
|
<result column="manufacturer" jdbcType="VARCHAR" property="manufacturer" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, orderIdFk, cpmctymc, relId, thrCode, nameCode, ggxh, batchNo, measname, price,
|
||||||
|
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh, inCount, outCount, supName,
|
||||||
|
deptName, deptCode, invName, invCode, spaceCode, spaceName, reCount, mainAction,
|
||||||
|
manufacturer, remark
|
||||||
|
</sql>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from thr_inv_order_detail
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
delete from thr_inv_order_detail
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrderDetail" useGeneratedKeys="true">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
insert into thr_inv_order_detail (orderIdFk, cpmctymc, relId,
|
||||||
|
thrCode, nameCode, ggxh,
|
||||||
|
batchNo, measname, price,
|
||||||
|
productionDate, expireDate, ylqxzcrbarmc,
|
||||||
|
zczbhhzbapzbh, inCount, outCount,
|
||||||
|
supName, deptName, deptCode,
|
||||||
|
invName, invCode, spaceCode,
|
||||||
|
spaceName, reCount, mainAction,
|
||||||
|
manufacturer, remark)
|
||||||
|
values (#{orderIdFk,jdbcType=VARCHAR}, #{cpmctymc,jdbcType=VARCHAR}, #{relId,jdbcType=INTEGER},
|
||||||
|
#{thrCode,jdbcType=VARCHAR}, #{nameCode,jdbcType=VARCHAR}, #{ggxh,jdbcType=VARCHAR},
|
||||||
|
#{batchNo,jdbcType=INTEGER}, #{measname,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
|
||||||
|
#{productionDate,jdbcType=TIMESTAMP}, #{expireDate,jdbcType=TIMESTAMP}, #{ylqxzcrbarmc,jdbcType=VARCHAR},
|
||||||
|
#{zczbhhzbapzbh,jdbcType=VARCHAR}, #{inCount,jdbcType=VARCHAR}, #{outCount,jdbcType=VARCHAR},
|
||||||
|
#{supName,jdbcType=VARCHAR}, #{deptName,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR},
|
||||||
|
#{invName,jdbcType=VARCHAR}, #{invCode,jdbcType=VARCHAR}, #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
#{spaceName,jdbcType=VARCHAR}, #{reCount,jdbcType=VARCHAR}, #{mainAction,jdbcType=VARCHAR},
|
||||||
|
#{manufacturer,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrderDetail" useGeneratedKeys="true">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
insert into thr_inv_order_detail
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderIdFk != null">
|
||||||
|
orderIdFk,
|
||||||
|
</if>
|
||||||
|
<if test="cpmctymc != null">
|
||||||
|
cpmctymc,
|
||||||
|
</if>
|
||||||
|
<if test="relId != null">
|
||||||
|
relId,
|
||||||
|
</if>
|
||||||
|
<if test="thrCode != null">
|
||||||
|
thrCode,
|
||||||
|
</if>
|
||||||
|
<if test="nameCode != null">
|
||||||
|
nameCode,
|
||||||
|
</if>
|
||||||
|
<if test="ggxh != null">
|
||||||
|
ggxh,
|
||||||
|
</if>
|
||||||
|
<if test="batchNo != null">
|
||||||
|
batchNo,
|
||||||
|
</if>
|
||||||
|
<if test="measname != null">
|
||||||
|
measname,
|
||||||
|
</if>
|
||||||
|
<if test="price != null">
|
||||||
|
price,
|
||||||
|
</if>
|
||||||
|
<if test="productionDate != null">
|
||||||
|
productionDate,
|
||||||
|
</if>
|
||||||
|
<if test="expireDate != null">
|
||||||
|
expireDate,
|
||||||
|
</if>
|
||||||
|
<if test="ylqxzcrbarmc != null">
|
||||||
|
ylqxzcrbarmc,
|
||||||
|
</if>
|
||||||
|
<if test="zczbhhzbapzbh != null">
|
||||||
|
zczbhhzbapzbh,
|
||||||
|
</if>
|
||||||
|
<if test="inCount != null">
|
||||||
|
inCount,
|
||||||
|
</if>
|
||||||
|
<if test="outCount != null">
|
||||||
|
outCount,
|
||||||
|
</if>
|
||||||
|
<if test="supName != null">
|
||||||
|
supName,
|
||||||
|
</if>
|
||||||
|
<if test="deptName != null">
|
||||||
|
deptName,
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
deptCode,
|
||||||
|
</if>
|
||||||
|
<if test="invName != null">
|
||||||
|
invName,
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
invCode,
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
spaceCode,
|
||||||
|
</if>
|
||||||
|
<if test="spaceName != null">
|
||||||
|
spaceName,
|
||||||
|
</if>
|
||||||
|
<if test="reCount != null">
|
||||||
|
reCount,
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
mainAction,
|
||||||
|
</if>
|
||||||
|
<if test="manufacturer != null">
|
||||||
|
manufacturer,
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderIdFk != null">
|
||||||
|
#{orderIdFk,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="cpmctymc != null">
|
||||||
|
#{cpmctymc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="relId != null">
|
||||||
|
#{relId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="thrCode != null">
|
||||||
|
#{thrCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="nameCode != null">
|
||||||
|
#{nameCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="ggxh != null">
|
||||||
|
#{ggxh,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="batchNo != null">
|
||||||
|
#{batchNo,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="measname != null">
|
||||||
|
#{measname,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="price != null">
|
||||||
|
#{price,jdbcType=DECIMAL},
|
||||||
|
</if>
|
||||||
|
<if test="productionDate != null">
|
||||||
|
#{productionDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="expireDate != null">
|
||||||
|
#{expireDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="ylqxzcrbarmc != null">
|
||||||
|
#{ylqxzcrbarmc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="zczbhhzbapzbh != null">
|
||||||
|
#{zczbhhzbapzbh,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="inCount != null">
|
||||||
|
#{inCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="outCount != null">
|
||||||
|
#{outCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="supName != null">
|
||||||
|
#{supName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptName != null">
|
||||||
|
#{deptName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
#{deptCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invName != null">
|
||||||
|
#{invName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
#{invCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
#{spaceCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceName != null">
|
||||||
|
#{spaceName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="reCount != null">
|
||||||
|
#{reCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
#{mainAction,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="manufacturer != null">
|
||||||
|
#{manufacturer,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
#{remark,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.thrsys.ThrInvOrderDetail">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
update thr_inv_order_detail
|
||||||
|
<set>
|
||||||
|
<if test="orderIdFk != null">
|
||||||
|
orderIdFk = #{orderIdFk,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="cpmctymc != null">
|
||||||
|
cpmctymc = #{cpmctymc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="relId != null">
|
||||||
|
relId = #{relId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="thrCode != null">
|
||||||
|
thrCode = #{thrCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="nameCode != null">
|
||||||
|
nameCode = #{nameCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="ggxh != null">
|
||||||
|
ggxh = #{ggxh,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="batchNo != null">
|
||||||
|
batchNo = #{batchNo,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="measname != null">
|
||||||
|
measname = #{measname,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="price != null">
|
||||||
|
price = #{price,jdbcType=DECIMAL},
|
||||||
|
</if>
|
||||||
|
<if test="productionDate != null">
|
||||||
|
productionDate = #{productionDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="expireDate != null">
|
||||||
|
expireDate = #{expireDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="ylqxzcrbarmc != null">
|
||||||
|
ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="zczbhhzbapzbh != null">
|
||||||
|
zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="inCount != null">
|
||||||
|
inCount = #{inCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="outCount != null">
|
||||||
|
outCount = #{outCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="supName != null">
|
||||||
|
supName = #{supName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptName != null">
|
||||||
|
deptName = #{deptName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invName != null">
|
||||||
|
invName = #{invName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
invCode = #{invCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceName != null">
|
||||||
|
spaceName = #{spaceName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="reCount != null">
|
||||||
|
reCount = #{reCount,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="manufacturer != null">
|
||||||
|
manufacturer = #{manufacturer,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark = #{remark,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.thrsys.ThrInvOrderDetail">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
update thr_inv_order_detail
|
||||||
|
set orderIdFk = #{orderIdFk,jdbcType=VARCHAR},
|
||||||
|
cpmctymc = #{cpmctymc,jdbcType=VARCHAR},
|
||||||
|
relId = #{relId,jdbcType=INTEGER},
|
||||||
|
thrCode = #{thrCode,jdbcType=VARCHAR},
|
||||||
|
nameCode = #{nameCode,jdbcType=VARCHAR},
|
||||||
|
ggxh = #{ggxh,jdbcType=VARCHAR},
|
||||||
|
batchNo = #{batchNo,jdbcType=INTEGER},
|
||||||
|
measname = #{measname,jdbcType=VARCHAR},
|
||||||
|
price = #{price,jdbcType=DECIMAL},
|
||||||
|
productionDate = #{productionDate,jdbcType=TIMESTAMP},
|
||||||
|
expireDate = #{expireDate,jdbcType=TIMESTAMP},
|
||||||
|
ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
|
||||||
|
zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
|
||||||
|
inCount = #{inCount,jdbcType=VARCHAR},
|
||||||
|
outCount = #{outCount,jdbcType=VARCHAR},
|
||||||
|
supName = #{supName,jdbcType=VARCHAR},
|
||||||
|
deptName = #{deptName,jdbcType=VARCHAR},
|
||||||
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
||||||
|
invName = #{invName,jdbcType=VARCHAR},
|
||||||
|
invCode = #{invCode,jdbcType=VARCHAR},
|
||||||
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
spaceName = #{spaceName,jdbcType=VARCHAR},
|
||||||
|
reCount = #{reCount,jdbcType=VARCHAR},
|
||||||
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
||||||
|
manufacturer = #{manufacturer,jdbcType=VARCHAR},
|
||||||
|
remark = #{remark,jdbcType=VARCHAR}
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,226 @@
|
|||||||
|
<?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.glxp.api.dao.thrsys.ThrInvOrderMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvOrder">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table thr_inv_order-->
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="billNo" jdbcType="VARCHAR" property="billNo" />
|
||||||
|
<result column="billDate" jdbcType="TIMESTAMP" property="billDate" />
|
||||||
|
<result column="startDate" jdbcType="TIMESTAMP" property="startDate" />
|
||||||
|
<result column="endDate" jdbcType="TIMESTAMP" property="endDate" />
|
||||||
|
<result column="mainAction" jdbcType="VARCHAR" property="mainAction" />
|
||||||
|
<result column="billType" jdbcType="VARCHAR" property="billType" />
|
||||||
|
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" />
|
||||||
|
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
|
||||||
|
<result column="spaceCode" jdbcType="VARCHAR" property="spaceCode" />
|
||||||
|
<result column="status" jdbcType="TINYINT" property="status" />
|
||||||
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||||
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, billNo, billDate, startDate, endDate, mainAction, billType, deptCode, invCode,
|
||||||
|
spaceCode, `status`, createTime, `createUser`, updateTime, updateUser, remark
|
||||||
|
</sql>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from thr_inv_order
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
delete from thr_inv_order
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
insert into thr_inv_order (billNo, billDate, startDate,
|
||||||
|
endDate, mainAction, billType,
|
||||||
|
deptCode, invCode, spaceCode,
|
||||||
|
`status`, createTime, `createUser`,
|
||||||
|
updateTime, updateUser, remark
|
||||||
|
)
|
||||||
|
values (#{billNo,jdbcType=VARCHAR}, #{billDate,jdbcType=TIMESTAMP}, #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
#{endDate,jdbcType=TIMESTAMP}, #{mainAction,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR},
|
||||||
|
#{deptCode,jdbcType=VARCHAR}, #{invCode,jdbcType=VARCHAR}, #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
#{status,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=VARCHAR},
|
||||||
|
#{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
insert into thr_inv_order
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="billNo != null">
|
||||||
|
billNo,
|
||||||
|
</if>
|
||||||
|
<if test="billDate != null">
|
||||||
|
billDate,
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
startDate,
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
endDate,
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
mainAction,
|
||||||
|
</if>
|
||||||
|
<if test="billType != null">
|
||||||
|
billType,
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
deptCode,
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
invCode,
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
spaceCode,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status`,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
createTime,
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
`createUser`,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
updateTime,
|
||||||
|
</if>
|
||||||
|
<if test="updateUser != null">
|
||||||
|
updateUser,
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="billNo != null">
|
||||||
|
#{billNo,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="billDate != null">
|
||||||
|
#{billDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
#{startDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
#{endDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
#{mainAction,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="billType != null">
|
||||||
|
#{billType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
#{deptCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
#{invCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
#{spaceCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status,jdbcType=TINYINT},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
#{createUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="updateUser != null">
|
||||||
|
#{updateUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
#{remark,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
update thr_inv_order
|
||||||
|
<set>
|
||||||
|
<if test="billNo != null">
|
||||||
|
billNo = #{billNo,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="billDate != null">
|
||||||
|
billDate = #{billDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
startDate = #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
endDate = #{endDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="mainAction != null">
|
||||||
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="billType != null">
|
||||||
|
billType = #{billType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != null">
|
||||||
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="invCode != null">
|
||||||
|
invCode = #{invCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="spaceCode != null">
|
||||||
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status` = #{status,jdbcType=TINYINT},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="updateUser != null">
|
||||||
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark = #{remark,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
update thr_inv_order
|
||||||
|
set billNo = #{billNo,jdbcType=VARCHAR},
|
||||||
|
billDate = #{billDate,jdbcType=TIMESTAMP},
|
||||||
|
startDate = #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
endDate = #{endDate,jdbcType=TIMESTAMP},
|
||||||
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
||||||
|
billType = #{billType,jdbcType=VARCHAR},
|
||||||
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
||||||
|
invCode = #{invCode,jdbcType=VARCHAR},
|
||||||
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
||||||
|
`status` = #{status,jdbcType=TINYINT},
|
||||||
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||||
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||||
|
remark = #{remark,jdbcType=VARCHAR}
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue