parent
86bef484e7
commit
607fdd33da
@ -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; |
||||
} |
||||
} |
@ -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…
Reference in new issue