结算单管理

release
gongquanlin 2 years ago
parent 86bef484e7
commit 607fdd33da
  1. 95
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/controller/UnitConversionController.java
  2. 66
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/dao/UnitConversionDao.java
  3. 87
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/entity/UnitConversion.java
  4. 104
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/model/UnitConversionDTO.java
  5. 104
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/model/UnitConversionQueryDTO.java
  6. 62
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/service/UnitConversionService.java
  7. 120
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/unitconversion/service/impl/UnitConversionServiceImpl.java
  8. 58
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/CommonInterfaceServiceImpl.java
  9. 91
      order-management-consumer/src/main/resources/mybatis/mapper/UnitConversionDao.xml

@ -0,0 +1,95 @@
package com.dxhy.order.consumer.modules.unitconversion.controller;
import com.dxhy.order.consumer.modules.commodity.domain.dto.QueryGroupCommodityDTO;
import com.dxhy.order.consumer.modules.commodity.service.IGroupCommodityCodeService;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionDTO;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionQueryDTO;
import com.dxhy.order.consumer.modules.unitconversion.service.UnitConversionService;
import com.dxhy.order.consumer.openapi.protocol.AjaxResult;
import com.dxhy.order.model.PageUtils;
import com.dxhy.order.model.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
/**
* (UnitConversion)表控制层
*
* @author Gong Quanlin
* @since 2023-03-18 14:49:18
*/
@RequestMapping(value = "/unitConversion")
@RestController
@Slf4j
public class UnitConversionController {
private final static String LOGGER_MSG = "(单位转换编码)";
/**
* 服务对象
*/
@Resource
private UnitConversionService unitConversionService;
/**
* 通过主键查询单条数据
*
* @param dto 主键
* @return 单条数据
*/
@GetMapping("/list")
public R list(@Validated UnitConversionQueryDTO dto) {
try {
PageUtils pageUtil = unitConversionService.queryList(dto);
return R.ok().put("page", pageUtil);
} catch (NumberFormatException e) {
log.error("{},分页参数类型转换异常:{}", LOGGER_MSG, e.getMessage());
return R.error("商品信息列表查询异常");
}
}
@PostMapping("/create")
public R create(@RequestBody @Validated UnitConversionDTO dto) {
return unitConversionService.insert(dto) > 0 ? R.ok() : R.error("插入失败");
}
@PutMapping("/edit")
public R edit(@RequestBody @Validated UnitConversionDTO dto) {
UnitConversion updateEntity = new UnitConversion();
if (StringUtils.isEmpty(dto.getId())) {
return R.error("id不能为空!");
}
try {
BeanUtils.copyProperties(updateEntity, dto);
if (unitConversionService.update(updateEntity) > 0) {
return R.ok();
} else {
return R.error("更新失败,未进行更新");
}
} catch (IllegalAccessException e) {
log.error("{},更新物料分类编码异常", LOGGER_MSG, e);
return R.error("更新出错,错误原因:" + e.getMessage());
} catch (InvocationTargetException e) {
log.error("{},更新物料分类编码异常", LOGGER_MSG, e);
return R.error("更新出错,错误原因:" + e.getMessage());
}
}
@DeleteMapping("/delete")
public R delete(@RequestBody UnitConversion dto) {
if (StringUtils.isEmpty(dto.getId())) {
return R.error("id不能为空!");
}
return unitConversionService.deleteById(dto.getId()) ? R.ok() : R.error();
}
}

@ -0,0 +1,66 @@
package com.dxhy.order.consumer.modules.unitconversion.dao;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (UnitConversion)表数据库访问层
*
* @author Gong Quanlin
* @since 2023-03-18 14:49:17
*/
public interface UnitConversionDao {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
UnitConversion queryById(String id);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<UnitConversion> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
/**
* 通过实体作为筛选条件查询
*
* @param unitConversion 实例对象
* @return 对象列表
*/
List<UnitConversion> queryAll(UnitConversion unitConversion);
/**
* 新增数据
*
* @param unitConversion 实例对象
* @return 影响行数
*/
int insert(UnitConversion unitConversion);
/**
* 修改数据
*
* @param unitConversion 实例对象
* @return 影响行数
*/
int update(UnitConversion unitConversion);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(String id);
}

@ -0,0 +1,87 @@
package com.dxhy.order.consumer.modules.unitconversion.entity;
import java.io.Serializable;
/**
* (UnitConversion)实体类
*
* @author Gong Quanlin
* @since 2023-03-18 14:49:16
*/
public class UnitConversion implements Serializable {
private static final long serialVersionUID = -36936011982521247L;
/**
* id
*/
private String id;
/**
* 销方税号
*/
private String xhfNsrsbh;
/**
* 数据权限id
*/
private String entId;
/**
* 原单位
*/
private String originUnit;
/**
* 新单位
*/
private String newUnit;
/**
* 比率
*/
private String rate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getXhfNsrsbh() {
return xhfNsrsbh;
}
public void setXhfNsrsbh(String xhfNsrsbh) {
this.xhfNsrsbh = xhfNsrsbh;
}
public String getEntId() {
return entId;
}
public void setEntId(String entId) {
this.entId = entId;
}
public String getOriginUnit() {
return originUnit;
}
public void setOriginUnit(String originUnit) {
this.originUnit = originUnit;
}
public String getNewUnit() {
return newUnit;
}
public void setNewUnit(String newUnit) {
this.newUnit = newUnit;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
}

@ -0,0 +1,104 @@
package com.dxhy.order.consumer.modules.unitconversion.model;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import javax.validation.constraints.NotEmpty;
/**
* @Description
* @Author 巩权林
* @Date 2023/3/18 15:41
**/
public class UnitConversionDTO extends UnitConversion {
private String id;
@NotEmpty(message = "销货方纳税人识别号不能为空!")
private String xhfNsrsbh;
@NotEmpty(message = "数据权限id不能为空!")
private String entId;
@NotEmpty(message = "原单位不能为空!")
private String originUnit;
@NotEmpty(message = "新单位不能为空!")
private String newUnit;
@NotEmpty(message = "比率不能为空!")
private String rate;
private Integer currPage;
private Integer pageSize;
public Integer getCurrPage() {
return currPage;
}
public void setCurrPage(Integer currPage) {
this.currPage = currPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
@Override
public String getXhfNsrsbh() {
return xhfNsrsbh;
}
@Override
public void setXhfNsrsbh(String xhfNsrsbh) {
this.xhfNsrsbh = xhfNsrsbh;
}
@Override
public String getEntId() {
return entId;
}
@Override
public void setEntId(String entId) {
this.entId = entId;
}
@Override
public String getOriginUnit() {
return originUnit;
}
@Override
public void setOriginUnit(String originUnit) {
this.originUnit = originUnit;
}
@Override
public String getNewUnit() {
return newUnit;
}
@Override
public void setNewUnit(String newUnit) {
this.newUnit = newUnit;
}
@Override
public String getRate() {
return rate;
}
@Override
public void setRate(String rate) {
this.rate = rate;
}
}

@ -0,0 +1,104 @@
package com.dxhy.order.consumer.modules.unitconversion.model;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import javax.validation.constraints.NotEmpty;
/**
* @Description
* @Author 巩权林
* @Date 2023/3/18 15:41
**/
public class UnitConversionQueryDTO extends UnitConversion {
private String id;
@NotEmpty(message = "销货方纳税人识别号不能为空!")
private String xhfNsrsbh;
@NotEmpty(message = "数据权限id不能为空!")
private String entId;
private String originUnit;
private String newUnit;
private String rate;
private Integer currPage;
private Integer pageSize;
public Integer getCurrPage() {
return currPage;
}
public void setCurrPage(Integer currPage) {
this.currPage = currPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
@Override
public String getXhfNsrsbh() {
return xhfNsrsbh;
}
@Override
public void setXhfNsrsbh(String xhfNsrsbh) {
this.xhfNsrsbh = xhfNsrsbh;
}
@Override
public String getEntId() {
return entId;
}
@Override
public void setEntId(String entId) {
this.entId = entId;
}
@Override
public String getOriginUnit() {
return originUnit;
}
@Override
public void setOriginUnit(String originUnit) {
this.originUnit = originUnit;
}
@Override
public String getNewUnit() {
return newUnit;
}
@Override
public void setNewUnit(String newUnit) {
this.newUnit = newUnit;
}
@Override
public String getRate() {
return rate;
}
@Override
public void setRate(String rate) {
this.rate = rate;
}
}

@ -0,0 +1,62 @@
package com.dxhy.order.consumer.modules.unitconversion.service;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionDTO;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionQueryDTO;
import com.dxhy.order.model.PageUtils;
import java.util.List;
/**
* (UnitConversion)表服务接口
*
* @author Gong Quanlin
* @since 2023-03-18 14:49:18
*/
public interface UnitConversionService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
UnitConversion queryById(String id);
PageUtils queryList(UnitConversionQueryDTO dto);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List<UnitConversion> queryAllByLimit(int offset, int limit);
/**
* 新增数据
*
* @param unitConversion 实例对象
* @return 实例对象
*/
int insert(UnitConversion unitConversion);
/**
* 修改数据
*
* @param unitConversion 实例对象
* @return 实例对象
*/
int update(UnitConversion unitConversion);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(String id);
}

@ -0,0 +1,120 @@
package com.dxhy.order.consumer.modules.unitconversion.service.impl;
import com.dxhy.order.baseservice.module.base.service.BaseService;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion;
import com.dxhy.order.consumer.modules.unitconversion.dao.UnitConversionDao;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionDTO;
import com.dxhy.order.consumer.modules.unitconversion.model.UnitConversionQueryDTO;
import com.dxhy.order.consumer.modules.unitconversion.service.UnitConversionService;
import com.dxhy.order.model.PageUtils;
import com.dxhy.order.model.R;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
/**
* (UnitConversion)表服务实现类
*
* @author Gong Quanlin
* @since 2023-03-18 14:49:18
*/
@Service("/unitConversionService")
@Slf4j
public class UnitConversionServiceImpl implements UnitConversionService {
private final static String LOGGER_MSG = "(单位转换服务类)";
@Resource
private UnitConversionDao unitConversionDao;
@Autowired
private BaseService baseService;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public UnitConversion queryById(String id) {
return this.unitConversionDao.queryById(id);
}
@Override
public PageUtils queryList(UnitConversionQueryDTO dto) {
int pageSize = dto.getPageSize();
int currPage = dto.getCurrPage();
PageHelper.startPage(currPage, pageSize);
UnitConversion query = new UnitConversion();
try {
BeanUtils.copyProperties(query, dto);
} catch (IllegalAccessException e) {
log.error(LOGGER_MSG + "查询物料分类编码异常", e);
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
log.error(LOGGER_MSG + "查询物料分类编码异常", e);
throw new RuntimeException(e);
}
List<UnitConversion> result = unitConversionDao.queryAll(query);
PageInfo<UnitConversion> pageInfo = new PageInfo<>(result);
return new PageUtils(pageInfo.getList(), (int) pageInfo.getTotal(), pageInfo.getPageSize(), pageInfo.getPageNum());
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public List<UnitConversion> queryAllByLimit(int offset, int limit) {
return this.unitConversionDao.queryAllByLimit(offset, limit);
}
/**
* 新增数据
*
* @param unitConversion 实例对象
* @return 实例对象
*/
@Override
public int insert(UnitConversion unitConversion) {
unitConversion.setId(baseService.getGenerateShotKey());
return this.unitConversionDao.insert(unitConversion);
}
/**
* 修改数据
*
* @param unitConversion 实例对象
* @return 实例对象
*/
@Override
public int update(UnitConversion unitConversion) {
return this.unitConversionDao.update(unitConversion);
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(String id) {
return this.unitConversionDao.deleteById(id) > 0;
}
}

@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.base.model.DrawerInfoEntity;
import com.dxhy.order.baseservice.module.base.model.SpjcXx;
@ -12,10 +13,14 @@ import com.dxhy.order.baseservice.module.base.service.BaseService;
import com.dxhy.order.baseservice.module.base.service.DrawerInfoService;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.baseservice.module.commodity.service.CommodityService;
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper;
import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity;
import com.dxhy.order.constant.*;
import com.dxhy.order.consumer.constant.RespStatusEnum;
import com.dxhy.order.consumer.dao.GroupCommodityCodeMapper;
import com.dxhy.order.consumer.model.protocol.ResponseStatus;
import com.dxhy.order.consumer.model.protocol.Result;
import com.dxhy.order.consumer.modules.commodity.service.IGroupCommodityCodeService;
import com.dxhy.order.consumer.modules.order.service.OrderBatchRequestService;
import com.dxhy.order.consumer.modules.order.service.OrderCommonService;
import com.dxhy.order.consumer.openapi.protocol.CheckResult;
@ -34,6 +39,7 @@ import com.dxhy.order.model.sk.sld.SearchSld;
import com.dxhy.order.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -86,6 +92,12 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
@Resource
private BaseServiceConfig baseServiceConfig;
@Autowired
private GroupCommodityCodeMapper commodityCodeMapper;
@Resource
private TaxClassCodeMapper taxClassCodeMapper;
/**
* 校验接口入参数据,非空和数据校验
@ -512,6 +524,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
* 2.1 商品编码不为空使用商品编码补全
* 2.2 商品编码为空项目名称不为空使用商品名称补全
*/
item.setZnfm("0");
if (StringUtils.isNotBlank(item.getSpId())) {
R r = commodityService.queryCommodityById(item.getSpId(), shList);
if (ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
@ -562,6 +575,41 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
CommodityCodeEntity commodityCodeEntity = queryProductList.get(0);
completeCommodityMessageByXmmc(item, commodityCodeEntity);
} else if (StringUtils.isNotBlank(item.getZxbm())) {
// 自行编码为mdm的物料编码,通过这个去匹配
// 4.2.1.11
// 先从公司物料库匹配
CommodityCodeEntity commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbh(item.getZxbm(), xhfNsrsbh);
if (commodityCodeEntity == null) {
// 如果匹配不到,则去集团物料库匹配
commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbh(item.getZxbm(), "-1");
if (commodityCodeEntity == null) {
// ③ 若通过集团物料库仍未匹配到税编信息则,使用“物料名称”进行智能赋码开票(用SAAS接口赋码)
// 智能赋码接口
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("parameter", item.getXmmc());
List<TaxClassCodeEntity> taxClassList = taxClassCodeMapper.selectTaxClassCode(paramMap);
if (CollectionUtils.isNotEmpty(taxClassList)) {
// TODO 配置税收分类编码字段
TaxClassCodeEntity taxClassCodeEntity = taxClassList.get(0);
item.setSpbm(taxClassCodeEntity.getSpbm());
// item.setYhzcbs(taxClassCodeEntity.getYhzcmc()); // TODO 优惠政策
item.setZzstsgl(taxClassCodeEntity.getZzstsgl());
item.setZnfm("1"); // 配置为智能赋码
}
}
}
// 如果没有找到,记录异常
if (commodityCodeEntity == null) {
log.error("{}根据商品名称查询到的商品为空,商品名称:{}", LOGGER_MSG, item.getXmmc());
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage())
.append("\r\n");
}
} else {
//商品编码不为空,需要调用底层商品编码获取简码接口获取数据
String spbm = item.getSpbm();
@ -596,10 +644,11 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
/**
* 补全商品信息 通过商品ID
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-03-22
*
* @param item 订单明细数据
* @param commodity 从数据库查询的商品信息
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-03-22
*/
private void completeCommodityMessageBySpid(OrderItemInfo item, CommodityCodeEntity commodity) {
//商品编码
@ -675,10 +724,11 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
/**
* 补全商品信息 通过项目名称
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-03-22
*
* @param item 订单明细数据
* @param commodity 从数据库查询的商品信息
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a>
* @date 2022-03-22
*/
private void completeCommodityMessageByXmmc(OrderItemInfo item, CommodityCodeEntity commodity) {
item.setSpbm(commodity.getSpbm());

@ -0,0 +1,91 @@
<?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.dxhy.order.consumer.modules.unitconversion.dao.UnitConversionDao">
<resultMap type="com.dxhy.order.consumer.modules.unitconversion.entity.UnitConversion" id="UnitConversionMap">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="xhfNsrsbh" column="xhf_nsrsbh" jdbcType="VARCHAR"/>
<result property="entId" column="ent_id" jdbcType="VARCHAR"/>
<result property="originUnit" column="origin_unit" jdbcType="VARCHAR"/>
<result property="newUnit" column="new_unit" jdbcType="VARCHAR"/>
<result property="rate" column="rate" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="UnitConversionMap">
select
id, xhf_nsrsbh, ent_id, origin_unit, new_unit, rate
from sales_order_sdenergy.unit_conversion
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="UnitConversionMap">
select
id, xhf_nsrsbh, ent_id, origin_unit, new_unit, rate
from sales_order_sdenergy.unit_conversion
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="UnitConversionMap">
select
id, xhf_nsrsbh, ent_id, origin_unit, new_unit, rate
from sales_order_sdenergy.unit_conversion
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="xhfNsrsbh != null and xhfNsrsbh != ''">
and xhf_nsrsbh = #{xhfNsrsbh}
</if>
<if test="entId != null and entId != ''">
and ent_id = #{entId}
</if>
<if test="originUnit != null and originUnit != ''">
and origin_unit = #{originUnit}
</if>
<if test="newUnit != null and newUnit != ''">
and new_unit = #{newUnit}
</if>
<if test="rate != null and rate != ''">
and rate = #{rate}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into sales_order_sdenergy.unit_conversion(id,xhf_nsrsbh, ent_id, origin_unit, new_unit, rate)
values (#{id},#{xhfNsrsbh}, #{entId}, #{originUnit}, #{newUnit}, #{rate})
</insert>
<!--通过主键修改数据-->
<update id="update">
update sales_order_sdenergy.unit_conversion
<set>
<if test="xhfNsrsbh != null and xhfNsrsbh != ''">
xhf_nsrsbh = #{xhfNsrsbh},
</if>
<if test="entId != null and entId != ''">
ent_id = #{entId},
</if>
<if test="originUnit != null and originUnit != ''">
origin_unit = #{originUnit},
</if>
<if test="newUnit != null and newUnit != ''">
new_unit = #{newUnit},
</if>
<if test="rate != null and rate != ''">
rate = #{rate},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from sales_order_sdenergy.unit_conversion where id = #{id}
</delete>
</mapper>
Loading…
Cancel
Save