This commit is contained in:
linfso 2025-01-21 00:46:16 +08:00
parent 3b724296ce
commit 4de8ff6f4d
9 changed files with 740 additions and 25 deletions

View File

@ -0,0 +1,134 @@
/**
* @Project: emis
* @Title: EmisWaybillOperLogController.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单操作日志 控制器 </p>
*/
package com.xdadan.erp.web.emis;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xdadan.erp.common.annotation.Log;
import com.xdadan.erp.common.core.controller.BaseController;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.page.TableDataInfo;
import com.xdadan.erp.common.enums.BusinessType;
import com.xdadan.erp.common.utils.StringUtils;
import com.xdadan.erp.common.utils.poi.ExcelUtil;
import com.xdadan.erp.emis.domain.EmisWaybillOperLog;
import com.xdadan.erp.emis.service.IEmisWaybillOperLogService;
/**
* 运单操作日志Controller
*
* @author linfso
* @date 2025-01-20 15:55:57
*/
@RestController
@RequestMapping("/emis/emisWaybillOperLog")
public class EmisWaybillOperLogController extends BaseController
{
@Autowired
private IEmisWaybillOperLogService emisWaybillOperLogService;
/**
* 查询运单操作日志列表
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:list')")
@GetMapping("/list")
public TableDataInfo list(EmisWaybillOperLog emisWaybillOperLog)
{
startPage();
List<EmisWaybillOperLog> list = emisWaybillOperLogService.selectEmisWaybillOperLogList(emisWaybillOperLog);
return getDataTable(list);
}
/**
* 检查是否重复
*
* @param emisWaybillOperLog
* @return 数量
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:list')")
@GetMapping("/checkUnique")
public AjaxResult checkUnique(EmisWaybillOperLog emisWaybillOperLog)
{
int cnt=emisWaybillOperLogService.checkUnique(emisWaybillOperLog);
return AjaxResult.success("检查成功",cnt);
}
/**
* 导出运单操作日志列表
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:export')")
@Log(title = "运单操作日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmisWaybillOperLog emisWaybillOperLog)
{
List<EmisWaybillOperLog> list = emisWaybillOperLogService.selectEmisWaybillOperLogList(emisWaybillOperLog);
ExcelUtil<EmisWaybillOperLog> util = new ExcelUtil<EmisWaybillOperLog>(EmisWaybillOperLog.class);
util.exportExcel(response, list, "运单操作日志数据");
}
/**
* 获取运单操作日志详细信息
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(emisWaybillOperLogService.selectEmisWaybillOperLogById(id));
}
/**
* 新增运单操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:add')")
@Log(title = "运单操作日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmisWaybillOperLog emisWaybillOperLog)
{
return toAjax(emisWaybillOperLogService.insertEmisWaybillOperLog(emisWaybillOperLog));
}
/**
* 修改运单操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:edit')")
@Log(title = "运单操作日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmisWaybillOperLog emisWaybillOperLog)
{
return toAjax(emisWaybillOperLogService.updateEmisWaybillOperLog(emisWaybillOperLog));
}
/**
* 删除运单操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisWaybillOperLog:remove')")
@Log(title = "运单操作日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(emisWaybillOperLogService.deleteEmisWaybillOperLogByIds(ids));
}
}

View File

@ -0,0 +1,64 @@
/**
* @Project: emis
* @Title: EmisWaybillOperLog.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单操作日志 实体类 </p>
*/
package com.xdadan.erp.emis.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xdadan.erp.common.annotation.Excel;
import com.xdadan.erp.common.core.domain.BaseEntity;
import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* @ClassName EmisWaybillOperLog
* @Description 运单操作日志
* @author linfso
* @date 2025-01-20 15:55:57
*/
@Data
public class EmisWaybillOperLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 实际运单号 */
private String billCode;
/* 订单号 */
private String orderSn;
/* 主单号 */
private String mainBillCode;
/* 是否子单 1-是 0-否 */
private String blSubBill;
/* 操作类型 1-下单 2-开单等 */
private String opType;
/* 操作时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date opDate;
/* 操作人 */
private String opManCode;
/* 操作名 */
private String opMan;
/* 操作站点 */
private String opSiteCode;
/* 操作站点名称 */
private String opSiteName;
/* 操作日志信息 */
private String opDesc;
/* 数据来源 pc,app,sapp */
private String dataFrom;
}

View File

@ -0,0 +1,30 @@
package com.xdadan.erp.emis.domain.enumtype;
/**
* 运单操作日志
* waybill operate log type
*/
public enum WaybillOperLogType {
CUST_CREATE_ORDER("1","客户下单"),
SITE_GOT("2","开单"),
SITE_MODIFY("3","改单"),
SITE_DEPARTURE("4","发件"),
SITE_ARRIVAL("5","到件"),
SITE_SENT("6","派送"),
CUST_SIGNED("7","签收"),
OTHER("99","其他"),
;
public String opType;
public String opName;
WaybillOperLogType(String opType, String opName) {
this.opType = opType;
this.opName = opName;
}
}

View File

@ -0,0 +1,80 @@
/**
* @Project: emis
* @Title: EmisWaybillOperLogMapper.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单操作日志 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
package com.xdadan.erp.emis.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.emis.domain.EmisWaybillOperLog;
/**
* @ClassName EmisWaybillOperLogMapper
* @Description <p> 运单操作日志 Mapper 接口 </p>
* @author linfso
* @date 2025-01-20 15:55:57
*/
public interface EmisWaybillOperLogMapper extends BaseMapper<EmisWaybillOperLog>
{
/**
* 主键查询
* @param id
* @return
*/
public EmisWaybillOperLog selectEmisWaybillOperLogById(Long id);
/**
* 查询列表
*
* @param emisWaybillOperLog
* @return 集合
*/
public List<EmisWaybillOperLog> selectEmisWaybillOperLogList(EmisWaybillOperLog emisWaybillOperLog);
/**
* 检查是否重复
*
* @param emisWaybillOperLog
* @return 数量
*/
public int checkUnique(EmisWaybillOperLog emisWaybillOperLog);
/**
* 新增
*
* @param emisWaybillOperLog
* @return
*/
public int insertEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog);
/**
* 修改
*
* @param emisWaybillOperLog
* @return
*/
public int updateEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog);
/**
* 删除
*
* @param id 主键
* @return 结果
*/
public int deleteEmisWaybillOperLogById(Long id);
/**
* 批量删除
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisWaybillOperLogByIds(Long[] ids);
}

View File

@ -11,62 +11,38 @@
package com.xdadan.erp.emis.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.db.DbUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.alibaba.fastjson.serializer.SerializeFilter;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ValueFilter;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.domain.entity.SysUser;
import com.xdadan.erp.common.core.page.TableDataInfo;
import com.xdadan.erp.common.core.redis.RedissonService;
import com.xdadan.erp.common.utils.*;
import com.xdadan.erp.common.utils.sign.MD5;
import com.xdadan.erp.emis.domain.*;
import com.xdadan.erp.emis.domain.enumtype.*;
import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.domain.stat.ScanStatInfoDtl;
import com.xdadan.erp.emis.domain.vo.WaybillOrder;
import com.xdadan.erp.emis.domain.vo.scan.ScanResultItem;
import com.xdadan.erp.emis.mapper.*;
import com.xdadan.erp.emis.service.IEmisWaybillAttachmentService;
import com.xdadan.erp.emis.service.IEmisWaybillCargoService;
import com.xdadan.erp.emis.service.IEmisWaybillFeeitemService;
import com.xdadan.erp.emis.service.IEmisWaybillService;
import com.xdadan.erp.emis.service.sms.AliyunSMSService;
import com.xdadan.erp.emis.service.sms.CMCCSMSService;
import com.xdadan.erp.emis.service.sms.Sms253Service;
import com.xdadan.erp.emis.utils.HTTPHelperV3;
import com.xdadan.erp.emis.utils.Kd100Helper;
import com.xdadan.erp.emis.utils.Q17trackHelper;
import com.xdadan.erp.emis.utils.WaybillHelper;
import com.xdadan.erp.emis.utils.sensitive.Convert;
import com.xdadan.erp.framework.manager.NoticManager;
import com.xdadan.erp.system.domain.SysPost;
import com.xdadan.erp.system.mapper.SysPostMapper;
import com.xdadan.erp.system.mapper.SysUserMapper;
import com.xdadan.erp.system.service.ISysConfigService;
import com.xdadan.erp.system.service.ISysNoticeService;
import com.xdadan.erp.system.service.ISysUserService;
import jdk.nashorn.internal.runtime.Undefined;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.WordUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -178,6 +154,10 @@ public class EmisBaseService {
emptySysUser.setOwnerSiteCode("0");
}
@Autowired
private EmisWaybillOperLogMapper emisWaybillOperLogMapper;
// @Autowired
// private CMCCSMSService cmccSMSService;
@ -224,6 +204,46 @@ public class EmisBaseService {
return emisExchangeRateMapper.getValidExchangeRate(from, to,rateDate);
}
/**
* 录入运单操作日志
* @param billCode
* @param operLogType
* @param operManName
* @param operSiteName
* @param operDesc
*/
public void recordWaybillOperLog(
String billCode,
WaybillOperLogType operLogType,
String operManName,
String operSiteName,
String operDesc
){
try {
String mainBillCode = getMainBillCode(billCode);
// 插入数据
EmisWaybillOperLog waybillOperLog = new EmisWaybillOperLog();
waybillOperLog.setBillCode(billCode);
waybillOperLog.setMainBillCode(mainBillCode);
if (!billCode.equals(mainBillCode)) {
waybillOperLog.setBlSubBill("1");
}
waybillOperLog.setOpMan(operManName);
waybillOperLog.setOpSiteName(operSiteName);
waybillOperLog.setOpType(operLogType.opType);
waybillOperLog.setOpDesc(operDesc);
waybillOperLog.setOpDate(new Date());
emisWaybillOperLogMapper.insertEmisWaybillOperLog(waybillOperLog);
}catch (Exception ex){
ex.printStackTrace();
}
}
/**
* 判断获取主单号
* @param billCode

View File

@ -0,0 +1,78 @@
/**
* @Project: emis
* @Title: EmisWaybillOperLogService.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单操作日志 服务类接口 </p>
*/
package com.xdadan.erp.emis.service;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisWaybillOperLog;
/**
* @ClassName EmisWaybillOperLogService
* @Description 运单操作日志
* @author linfso
* @date 2025-01-20 15:55:57
*/
public interface IEmisWaybillOperLogService
{
/**
* 主键查询
* @param id
* @return
*/
public EmisWaybillOperLog selectEmisWaybillOperLogById(Long id);
/**
* 查询运单操作日志列表
*
* @param emisWaybillOperLog 运单操作日志
* @return 运单操作日志集合
*/
public List<EmisWaybillOperLog> selectEmisWaybillOperLogList(EmisWaybillOperLog emisWaybillOperLog);
/**
* 检查是否重复
*
* @param emisWaybillOperLog
* @return 数量
*/
public int checkUnique(EmisWaybillOperLog emisWaybillOperLog);
/**
* 新增运单操作日志
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
public int insertEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog);
/**
* 修改运单操作日志
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
public int updateEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog);
/**
* 批量删除运单操作日志
*
* @param ids 需要删除的运单操作日志主键集合
* @return 结果
*/
public int deleteEmisWaybillOperLogByIds(Long[] ids);
/**
* 删除运单操作日志信息
*
* @param id 运单操作日志主键
* @return 结果
*/
public int deleteEmisWaybillOperLogById(Long id);
}

View File

@ -0,0 +1,117 @@
/**
* @Project: emis
* @Title: EmisWaybillOperLogServiceImpl.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单操作日志 实体类 </p>
*/
package com.xdadan.erp.emis.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisWaybillOperLog;
import com.xdadan.erp.emis.mapper.EmisWaybillOperLogMapper;
import com.xdadan.erp.emis.service.IEmisWaybillOperLogService;
/**
* 运单操作日志Service业务层处理
*
* @author linfso
* @date 2025-01-20 15:55:57
*/
@Service
public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
{
@Autowired
private EmisWaybillOperLogMapper emisWaybillOperLogMapper;
/**
* 查询运单操作日志
*
* @param id 运单操作日志主键
* @return 运单操作日志
*/
@Override
public EmisWaybillOperLog selectEmisWaybillOperLogById(Long id)
{
return emisWaybillOperLogMapper.selectEmisWaybillOperLogById(id);
}
/**
* 查询运单操作日志列表
*
* @param emisWaybillOperLog 运单操作日志
* @return 运单操作日志
*/
@Override
public List<EmisWaybillOperLog> selectEmisWaybillOperLogList(EmisWaybillOperLog emisWaybillOperLog)
{
return emisWaybillOperLogMapper.selectEmisWaybillOperLogList(emisWaybillOperLog);
}
/**
* 检查是否重复
*
* @param emisWaybillOperLog
* @return 数量
*/
@Override
public int checkUnique(EmisWaybillOperLog emisWaybillOperLog)
{
return emisWaybillOperLogMapper.checkUnique(emisWaybillOperLog);
}
/**
* 新增运单操作日志
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
@Override
public int insertEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog)
{
return emisWaybillOperLogMapper.insertEmisWaybillOperLog(emisWaybillOperLog);
}
/**
* 修改运单操作日志
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
@Override
public int updateEmisWaybillOperLog(EmisWaybillOperLog emisWaybillOperLog)
{
return emisWaybillOperLogMapper.updateEmisWaybillOperLog(emisWaybillOperLog);
}
/**
* 批量删除运单操作日志
*
* @param ids 需要删除的运单操作日志主键
* @return 结果
*/
@Override
public int deleteEmisWaybillOperLogByIds(Long[] ids)
{
return emisWaybillOperLogMapper.deleteEmisWaybillOperLogByIds(ids);
}
/**
* 删除运单操作日志信息
*
* @param id 运单操作日志主键
* @return 结果
*/
@Override
public int deleteEmisWaybillOperLogById(Long id)
{
return emisWaybillOperLogMapper.deleteEmisWaybillOperLogById(id);
}
}

View File

@ -2973,9 +2973,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
emisWaybillSave.setGoodsPics("1");
}
//补齐数据
//插入新单
emisWaybillMapper.insertEmisWaybill(emisWaybillSave);
// 运单日志记录
recordWaybillOperLog(
emisWaybillSave.getBillCode(),
WaybillOperLogType.SITE_GOT,
getCurrentUser().getEmpName(),
getCurrentUser().getOwnerSiteName(),
"网点揽收开单,网点:【"+getCurrentUser().getOwnerSiteName()+"】,录入人:【"+getCurrentUser().getEmpName()+"】"
);
// 绑定专属业务员
String bindEmpCode=emisWaybillSave.getTakePieceEmployeeCode();
if(StringUtils.isEmpty(bindEmpCode)){
@ -3163,6 +3172,15 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 插入运单数据
emisWaybillMapper.insertEmisWaybill(emisWaybillSave);
// 运单日志记录
recordWaybillOperLog(
emisWaybillSave.getBillCode(),
WaybillOperLogType.CUST_CREATE_ORDER,
emisWaybillSave.getCustomerName(),
null,
"客户下单"
);
// 产生主键插入其他数据
// 插入费用
List<EmisWaybillFeeitem> feeitemList=emisWaybillSave.getFeeitemList();

View File

@ -0,0 +1,174 @@
<?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.xdadan.erp.emis.mapper.EmisWaybillOperLogMapper">
<resultMap type="EmisWaybillOperLog" id="EmisWaybillOperLogResult">
<result property="id" column="id" />
<result property="billCode" column="bill_code" />
<result property="orderSn" column="order_sn" />
<result property="mainBillCode" column="main_bill_code" />
<result property="blSubBill" column="bl_sub_bill" />
<result property="opType" column="op_type" />
<result property="opDate" column="op_date" />
<result property="opManCode" column="op_man_code" />
<result property="opMan" column="op_man" />
<result property="opSiteCode" column="op_site_code" />
<result property="opSiteName" column="op_site_name" />
<result property="opDesc" column="op_desc" />
<result property="dataFrom" column="data_from" />
</resultMap>
<sql id="selectEmisWaybillOperLogVo">
select id, bill_code, order_sn, main_bill_code, bl_sub_bill, op_type, op_date, op_man_code, op_man, op_site_code, op_site_name, op_desc, data_from, del_flag, remark, create_by, create_time, update_by, update_time, update_site, create_site from emis_waybill_oper_log
</sql>
<select id="selectEmisWaybillOperLogList" parameterType="EmisWaybillOperLog" resultMap="EmisWaybillOperLogResult">
<include refid="selectEmisWaybillOperLogVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if>
<if test="orderSn != null and orderSn != ''"> and order_sn like concat('%', #{orderSn}, '%')</if>
<if test="mainBillCode != null and mainBillCode != ''"> and main_bill_code like concat('%', #{mainBillCode}, '%')</if>
<if test="blSubBill != null and blSubBill != ''"> and bl_sub_bill like concat('%', #{blSubBill}, '%')</if>
<if test="opType != null and opType != ''"> and op_type like concat('%', #{opType}, '%')</if>
<if test="opDate != null "> and op_date = #{opDate}</if>
<if test="opManCode != null and opManCode != ''"> and op_man_code like concat('%', #{opManCode}, '%')</if>
<if test="opMan != null and opMan != ''"> and op_man like concat('%', #{opMan}, '%')</if>
<if test="opSiteCode != null and opSiteCode != ''"> and op_site_code like concat('%', #{opSiteCode}, '%')</if>
<if test="opSiteName != null and opSiteName != ''"> and op_site_name like concat('%', #{opSiteName}, '%')</if>
<if test="opDesc != null and opDesc != ''"> and op_desc like concat('%', #{opDesc}, '%')</if>
<if test="dataFrom != null and dataFrom != ''"> and data_from like concat('%', #{dataFrom}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisWaybillOperLog" resultType="int">
select count(1) from emis_waybill_oper_log
where del_flag='0'
and id = #{id}
and bill_code = #{billCode}
and order_sn = #{orderSn}
and main_bill_code = #{mainBillCode}
and bl_sub_bill = #{blSubBill}
and op_type = #{opType}
and op_date = #{opDate}
and op_man_code = #{opManCode}
and op_man = #{opMan}
and op_site_code = #{opSiteCode}
and op_site_name = #{opSiteName}
and op_desc = #{opDesc}
and data_from = #{dataFrom}
and del_flag = #{delFlag}
and remark = #{remark}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and update_site = #{updateSite}
and create_site = #{createSite}
limit 1
</select>
<select id="selectEmisWaybillOperLogById" parameterType="Long" resultMap="EmisWaybillOperLogResult">
select id, bill_code, order_sn, main_bill_code, bl_sub_bill, op_type, op_date, op_man_code, op_man, op_site_code, op_site_name, op_desc, data_from, del_flag, remark, create_by, create_time, update_by, update_time, update_site, create_site
from emis_waybill_oper_log a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillOperLog" parameterType="EmisWaybillOperLog" useGeneratedKeys="true" keyProperty="id">
insert into emis_waybill_oper_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code,</if>
<if test="orderSn != null and orderSn != ''">order_sn,</if>
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code,</if>
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill,</if>
<if test="opType != null and opType != ''">op_type,</if>
<if test="opDate != null">op_date,</if>
<if test="opManCode != null and opManCode != ''">op_man_code,</if>
<if test="opMan != null and opMan != ''">op_man,</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code,</if>
<if test="opSiteName != null and opSiteName != ''">op_site_name,</if>
<if test="opDesc != null and opDesc != ''">op_desc,</if>
<if test="dataFrom != null and dataFrom != ''">data_from,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billCode != null and billCode != ''">#{billCode},</if>
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
<if test="mainBillCode != null and mainBillCode != ''">#{mainBillCode},</if>
<if test="blSubBill != null and blSubBill != ''">#{blSubBill},</if>
<if test="opType != null and opType != ''">#{opType},</if>
<if test="opDate != null">#{opDate},</if>
<if test="opManCode != null and opManCode != ''">#{opManCode},</if>
<if test="opMan != null and opMan != ''">#{opMan},</if>
<if test="opSiteCode != null and opSiteCode != ''">#{opSiteCode},</if>
<if test="opSiteName != null and opSiteName != ''">#{opSiteName},</if>
<if test="opDesc != null and opDesc != ''">#{opDesc},</if>
<if test="dataFrom != null and dataFrom != ''">#{dataFrom},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
</trim>
</insert>
<update id="updateEmisWaybillOperLog" parameterType="EmisWaybillOperLog">
update emis_waybill_oper_log
<trim prefix="SET" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="orderSn != null and orderSn != ''">order_sn = #{orderSn},</if>
<if test="mainBillCode != null and mainBillCode != ''">main_bill_code = #{mainBillCode},</if>
<if test="blSubBill != null and blSubBill != ''">bl_sub_bill = #{blSubBill},</if>
<if test="opType != null and opType != ''">op_type = #{opType},</if>
<if test="opDate != null">op_date = #{opDate},</if>
<if test="opManCode != null and opManCode != ''">op_man_code = #{opManCode},</if>
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code = #{opSiteCode},</if>
<if test="opSiteName != null and opSiteName != ''">op_site_name = #{opSiteName},</if>
<if test="opDesc != null and opDesc != ''">op_desc = #{opDesc},</if>
<if test="dataFrom != null and dataFrom != ''">data_from = #{dataFrom},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisWaybillOperLogById" parameterType="Long">
delete from emis_waybill_oper_log where id = #{id}
</delete>
<delete id="deleteEmisWaybillOperLogByIds" parameterType="String">
delete from emis_waybill_oper_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>