Merge branch 'master' of http://git.xdadan.loc/tanex/emis-service into develop
This commit is contained in:
commit
2d7f021860
@ -0,0 +1,134 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsCostQuotePriceController.java
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> TMS网点间供应商成本报价 控制器 </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.EmisTmsCostQuotePrice;
|
||||
import com.xdadan.erp.emis.service.IEmisTmsCostQuotePriceService;
|
||||
|
||||
/**
|
||||
* TMS网点间供应商成本报价Controller
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/emis/emisTmsCostQuotePrice")
|
||||
public class EmisTmsCostQuotePriceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisTmsCostQuotePriceService emisTmsCostQuotePriceService;
|
||||
|
||||
/**
|
||||
* 查询TMS网点间供应商成本报价列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
startPage();
|
||||
List<EmisTmsCostQuotePrice> list = emisTmsCostQuotePriceService.selectEmisTmsCostQuotePriceList(emisTmsCostQuotePrice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return 数量
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:list')")
|
||||
@GetMapping("/checkUnique")
|
||||
public AjaxResult checkUnique(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
int cnt=emisTmsCostQuotePriceService.checkUnique(emisTmsCostQuotePrice);
|
||||
return AjaxResult.success("检查成功",cnt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出TMS网点间供应商成本报价列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:export')")
|
||||
@Log(title = "TMS网点间供应商成本报价", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
List<EmisTmsCostQuotePrice> list = emisTmsCostQuotePriceService.selectEmisTmsCostQuotePriceList(emisTmsCostQuotePrice);
|
||||
ExcelUtil<EmisTmsCostQuotePrice> util = new ExcelUtil<EmisTmsCostQuotePrice>(EmisTmsCostQuotePrice.class);
|
||||
util.exportExcel(response, list, "TMS网点间供应商成本报价数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取TMS网点间供应商成本报价详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(emisTmsCostQuotePriceService.selectEmisTmsCostQuotePriceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增TMS网点间供应商成本报价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:add')")
|
||||
@Log(title = "TMS网点间供应商成本报价", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return toAjax(emisTmsCostQuotePriceService.insertEmisTmsCostQuotePrice(emisTmsCostQuotePrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改TMS网点间供应商成本报价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:edit')")
|
||||
@Log(title = "TMS网点间供应商成本报价", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return toAjax(emisTmsCostQuotePriceService.updateEmisTmsCostQuotePrice(emisTmsCostQuotePrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除TMS网点间供应商成本报价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisTmsCostQuotePrice:remove')")
|
||||
@Log(title = "TMS网点间供应商成本报价", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emisTmsCostQuotePriceService.deleteEmisTmsCostQuotePriceByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsCostQuotePrice.java
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> TMS网点间供应商成本报价 实体类 </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 EmisTmsCostQuotePrice
|
||||
* @Description TMS网点间供应商成本报价
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
*/
|
||||
@Data
|
||||
public class EmisTmsCostQuotePrice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/* id */
|
||||
private Long id;
|
||||
/* 起始网点 */
|
||||
private String startSiteCode;
|
||||
/* 下一网点 */
|
||||
private String nextSiteCode;
|
||||
/* 网点距离km */
|
||||
private BigDecimal distance;
|
||||
/* 费用类型 运输费 */
|
||||
private String feeType;
|
||||
/* 计费单价 */
|
||||
private BigDecimal price;
|
||||
/* 费用币种 */
|
||||
private String currency;
|
||||
/* 计费类型 1-重量计费 2-体积计费 */
|
||||
private String billType;
|
||||
/* 供应商代码 */
|
||||
private String supplierCode;
|
||||
/* 开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
/* 结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
|
||||
|
||||
// 扩展字段 ------
|
||||
/** 起始网点名称 */
|
||||
private String startSiteName;
|
||||
/** 下一网点名称 */
|
||||
private String nextSiteName;
|
||||
/** 供应商名称 */
|
||||
private String supplierName;
|
||||
|
||||
}
|
||||
@ -52,7 +52,7 @@ public interface EmisTmsCostFeeSplitMapper extends BaseMapper<EmisTmsCostFeeSpli
|
||||
|
||||
|
||||
|
||||
public double getCostFeeByBillCode(String billCode);
|
||||
public double getCostFeeByMainBillCode(String billCode);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsCostQuotePriceMapper.java
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> TMS网点间供应商成本报价 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.EmisTmsCostQuotePrice;
|
||||
/**
|
||||
* @ClassName EmisTmsCostQuotePriceMapper
|
||||
* @Description <p> TMS网点间供应商成本报价 Mapper 接口 </p>
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
*/
|
||||
public interface EmisTmsCostQuotePriceMapper extends BaseMapper<EmisTmsCostQuotePrice>
|
||||
{
|
||||
/**
|
||||
* 主键查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public EmisTmsCostQuotePrice selectEmisTmsCostQuotePriceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return 集合
|
||||
*/
|
||||
public List<EmisTmsCostQuotePrice> selectEmisTmsCostQuotePriceList(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return 数量
|
||||
*/
|
||||
public int checkUnique(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return
|
||||
*/
|
||||
public int insertEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return
|
||||
*/
|
||||
public int updateEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisTmsCostQuotePriceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisTmsCostQuotePriceByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsCostQuotePriceService.java
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> TMS网点间供应商成本报价 服务类接口 </p>
|
||||
*/
|
||||
package com.xdadan.erp.emis.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xdadan.erp.emis.domain.EmisTmsCostQuotePrice;
|
||||
|
||||
/**
|
||||
* @ClassName EmisTmsCostQuotePriceService
|
||||
* @Description TMS网点间供应商成本报价
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
*/
|
||||
public interface IEmisTmsCostQuotePriceService
|
||||
{
|
||||
/**
|
||||
* 主键查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public EmisTmsCostQuotePrice selectEmisTmsCostQuotePriceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询TMS网点间供应商成本报价列表
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return TMS网点间供应商成本报价集合
|
||||
*/
|
||||
public List<EmisTmsCostQuotePrice> selectEmisTmsCostQuotePriceList(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return 数量
|
||||
*/
|
||||
public int checkUnique(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
/**
|
||||
* 新增TMS网点间供应商成本报价
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
/**
|
||||
* 修改TMS网点间供应商成本报价
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice);
|
||||
|
||||
/**
|
||||
* 批量删除TMS网点间供应商成本报价
|
||||
*
|
||||
* @param ids 需要删除的TMS网点间供应商成本报价主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisTmsCostQuotePriceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除TMS网点间供应商成本报价信息
|
||||
*
|
||||
* @param id TMS网点间供应商成本报价主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisTmsCostQuotePriceById(Long id);
|
||||
}
|
||||
@ -373,10 +373,12 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
@Transactional
|
||||
public int mergeCostFeeByBillCode(String billCode) throws EmisBizError {
|
||||
|
||||
// 判断是虚拟单还是主单
|
||||
EmisWaybill emisWaybill=emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
||||
|
||||
EmisTmsCostProfit emisTmsCostProfit=emisTmsCostProfitMapper.selectEmisTmsCostProfitByBillCode(billCode);
|
||||
if(emisTmsCostProfit==null){
|
||||
// 获取成本数据
|
||||
EmisWaybill emisWaybill=emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
||||
emisTmsCostProfit = new EmisTmsCostProfit();
|
||||
emisTmsCostProfit.setBillCode(emisWaybill.getBillCode());
|
||||
emisTmsCostProfit.setBillFee(emisWaybill.getFreight());
|
||||
@ -388,8 +390,8 @@ public class EmisTmsCostFeeServiceImpl implements IEmisTmsCostFeeService
|
||||
updProfit.setId(emisTmsCostProfit.getId());
|
||||
updProfit.setBillFee(emisTmsCostProfit.getBillFee());
|
||||
|
||||
// 获取成本费用
|
||||
double costFee=emisTmsCostFeeSplitMapper.getCostFeeByBillCode(billCode);
|
||||
// 获取主单成本费用
|
||||
double costFee=emisTmsCostFeeSplitMapper.getCostFeeByMainBillCode(billCode);
|
||||
updProfit.setCostFee(BigDecimal.valueOf(costFee));
|
||||
updProfit.setBillProfit(emisTmsCostProfit.getBillFee().subtract(updProfit.getCostFee()));
|
||||
emisTmsCostProfitMapper.updateEmisTmsCostProfit(updProfit);
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsCostQuotePriceServiceImpl.java
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> TMS网点间供应商成本报价 实体类 </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.EmisTmsCostQuotePrice;
|
||||
import com.xdadan.erp.emis.mapper.EmisTmsCostQuotePriceMapper;
|
||||
import com.xdadan.erp.emis.service.IEmisTmsCostQuotePriceService;
|
||||
|
||||
/**
|
||||
* TMS网点间供应商成本报价Service业务层处理
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2025-06-29 14:27:48
|
||||
*/
|
||||
@Service
|
||||
public class EmisTmsCostQuotePriceServiceImpl implements IEmisTmsCostQuotePriceService
|
||||
{
|
||||
@Autowired
|
||||
private EmisTmsCostQuotePriceMapper emisTmsCostQuotePriceMapper;
|
||||
|
||||
/**
|
||||
* 查询TMS网点间供应商成本报价
|
||||
*
|
||||
* @param id TMS网点间供应商成本报价主键
|
||||
* @return TMS网点间供应商成本报价
|
||||
*/
|
||||
@Override
|
||||
public EmisTmsCostQuotePrice selectEmisTmsCostQuotePriceById(Long id)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.selectEmisTmsCostQuotePriceById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询TMS网点间供应商成本报价列表
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return TMS网点间供应商成本报价
|
||||
*/
|
||||
@Override
|
||||
public List<EmisTmsCostQuotePrice> selectEmisTmsCostQuotePriceList(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.selectEmisTmsCostQuotePriceList(emisTmsCostQuotePrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*
|
||||
* @param emisTmsCostQuotePrice
|
||||
* @return 数量
|
||||
*/
|
||||
@Override
|
||||
public int checkUnique(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.checkUnique(emisTmsCostQuotePrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增TMS网点间供应商成本报价
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.insertEmisTmsCostQuotePrice(emisTmsCostQuotePrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改TMS网点间供应商成本报价
|
||||
*
|
||||
* @param emisTmsCostQuotePrice TMS网点间供应商成本报价
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmisTmsCostQuotePrice(EmisTmsCostQuotePrice emisTmsCostQuotePrice)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.updateEmisTmsCostQuotePrice(emisTmsCostQuotePrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除TMS网点间供应商成本报价
|
||||
*
|
||||
* @param ids 需要删除的TMS网点间供应商成本报价主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmisTmsCostQuotePriceByIds(Long[] ids)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.deleteEmisTmsCostQuotePriceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除TMS网点间供应商成本报价信息
|
||||
*
|
||||
* @param id TMS网点间供应商成本报价主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmisTmsCostQuotePriceById(Long id)
|
||||
{
|
||||
return emisTmsCostQuotePriceMapper.deleteEmisTmsCostQuotePriceById(id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -207,5 +207,10 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSupplierNameByCode" parameterType="String" resultType="string">
|
||||
select a.name from emis_supplier a where a.code = #{code} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getCostFeeByBillCode" parameterType="String" resultType="double">
|
||||
<select id="getCostFeeByMainBillCode" parameterType="String" resultType="double">
|
||||
select IFNULL(sum(cost_fee),0) as costFee
|
||||
from emis_tms_cost_fee_split a
|
||||
where del_flag='0' and a.bill_code = #{billCode}
|
||||
|
||||
@ -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.EmisTmsCostQuotePriceMapper">
|
||||
|
||||
<resultMap type="EmisTmsCostQuotePrice" id="EmisTmsCostQuotePriceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="startSiteCode" column="start_site_code" />
|
||||
<result property="nextSiteCode" column="next_site_code" />
|
||||
<result property="distance" column="distance" />
|
||||
<result property="feeType" column="fee_type" />
|
||||
<result property="price" column="price" />
|
||||
<result property="currency" column="currency" />
|
||||
<result property="billType" column="bill_type" />
|
||||
<result property="supplierCode" column="supplier_code" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
|
||||
<association property="startSiteName" column="start_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
||||
<association property="nextSiteName" column="next_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
||||
<association property="supplierName" column="supplier_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSupplierNameByCode"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisTmsCostQuotePriceVo">
|
||||
select id, start_site_code, next_site_code, distance, fee_type, price, currency, bill_type, supplier_code, start_date, end_date, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_cost_quote_price
|
||||
</sql>
|
||||
|
||||
<select id="selectEmisTmsCostQuotePriceList" parameterType="EmisTmsCostQuotePrice" resultMap="EmisTmsCostQuotePriceResult">
|
||||
<include refid="selectEmisTmsCostQuotePriceVo"/>
|
||||
<where>
|
||||
del_flag='0'
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="startSiteCode != null and startSiteCode != ''"> and start_site_code = #{startSiteCode}</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code = #{nextSiteCode}</if>
|
||||
<if test="distance != null "> and distance = #{distance}</if>
|
||||
<if test="feeType != null and feeType != ''"> and fee_type = #{feeType}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="currency != null and currency != ''"> and currency = #{currency}</if>
|
||||
<if test="billType != null and billType != ''"> and bill_type = #{billType}</if>
|
||||
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
|
||||
<if test="startDate != null "> and start_date = #{startDate}</if>
|
||||
<if test="endDate != null "> and end_date = #{endDate}</if>
|
||||
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</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="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
||||
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="checkUnique" parameterType="EmisTmsCostQuotePrice" resultType="int">
|
||||
select count(1) from emis_tms_cost_quote_price
|
||||
where del_flag='0'
|
||||
and id = #{id}
|
||||
and start_site_code = #{startSiteCode}
|
||||
and next_site_code = #{nextSiteCode}
|
||||
and distance = #{distance}
|
||||
and fee_type = #{feeType}
|
||||
and price = #{price}
|
||||
and currency = #{currency}
|
||||
and bill_type = #{billType}
|
||||
and supplier_code = #{supplierCode}
|
||||
and start_date = #{startDate}
|
||||
and end_date = #{endDate}
|
||||
and remark = #{remark}
|
||||
and tenant_id = #{tenantId}
|
||||
and del_flag = #{delFlag}
|
||||
and create_by = #{createBy}
|
||||
and create_time = #{createTime}
|
||||
and update_by = #{updateBy}
|
||||
and update_time = #{updateTime}
|
||||
and create_site = #{createSite}
|
||||
and update_site = #{updateSite}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectEmisTmsCostQuotePriceById" parameterType="Long" resultMap="EmisTmsCostQuotePriceResult">
|
||||
select id, start_site_code, next_site_code, distance, fee_type, price, currency, bill_type, supplier_code, start_date, end_date, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
from emis_tms_cost_quote_price a
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmisTmsCostQuotePrice" parameterType="EmisTmsCostQuotePrice" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into emis_tms_cost_quote_price
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="startSiteCode != null and startSiteCode != ''">start_site_code,</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code,</if>
|
||||
<if test="distance != null">distance,</if>
|
||||
<if test="feeType != null and feeType != ''">fee_type,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="currency != null and currency != ''">currency,</if>
|
||||
<if test="billType != null and billType != ''">bill_type,</if>
|
||||
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</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="createSite != null and createSite != ''">create_site,</if>
|
||||
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="startSiteCode != null and startSiteCode != ''">#{startSiteCode},</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''">#{nextSiteCode},</if>
|
||||
<if test="distance != null">#{distance},</if>
|
||||
<if test="feeType != null and feeType != ''">#{feeType},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="currency != null and currency != ''">#{currency},</if>
|
||||
<if test="billType != null and billType != ''">#{billType},</if>
|
||||
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</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="createSite != null and createSite != ''">#{createSite},</if>
|
||||
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmisTmsCostQuotePrice" parameterType="EmisTmsCostQuotePrice">
|
||||
update emis_tms_cost_quote_price
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="startSiteCode != null and startSiteCode != ''">start_site_code = #{startSiteCode},</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
|
||||
<if test="distance != null">distance = #{distance},</if>
|
||||
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="currency != null and currency != ''">currency = #{currency},</if>
|
||||
<if test="billType != null and billType != ''">bill_type = #{billType},</if>
|
||||
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</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="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
||||
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisTmsCostQuotePriceById" parameterType="Long">
|
||||
delete from emis_tms_cost_quote_price where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmisTmsCostQuotePriceByIds" parameterType="String">
|
||||
delete from emis_tms_cost_quote_price where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user