瀏覽代碼

feat:分页问题bug

hmc 1 年之前
父節點
當前提交
f7027e79d3

+ 5 - 1
pom.xml

@@ -163,7 +163,11 @@
                 <artifactId>mybatis-plus-boot-starter</artifactId>
                 <version>3.5.2</version>
             </dependency>
-
+            <dependency>
+                <groupId>com.zkqy</groupId>
+                <artifactId>zkqy-custom-business</artifactId>
+                <version>3.8.5</version>
+            </dependency>
             <dependency>
                 <groupId>org.projectlombok</groupId>
                 <artifactId>lombok</artifactId>

+ 5 - 1
zkqy-custom-business/pom.xml

@@ -41,7 +41,11 @@
             <version>1.6.2</version>
             <scope>compile</scope>
         </dependency>
-
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.5.2</version>
+        </dependency>
     </dependencies>
 
     <properties>

+ 5 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/controller/InboundRecordsController.java

@@ -2,8 +2,13 @@ package com.zkqy.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.common.annotation.Anonymous;
+import com.zkqy.common.utils.ServletUtils;
+import com.zkqy.common.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.poi.util.StringUtil;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 50 - 60
zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterialInventoryController.java

@@ -18,14 +18,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-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 org.springframework.web.bind.annotation.*;
 import com.zkqy.common.annotation.Log;
 import com.zkqy.common.core.controller.BaseController;
 import com.zkqy.common.core.domain.AjaxResult;
@@ -44,8 +37,7 @@ import com.zkqy.common.core.page.TableDataInfo;
 @RestController
 @RequestMapping("/system/inventory")
 @Api(value = "/system/inventory", description = "物料库存-接口")
-public class MaterialInventoryController extends BaseController
-{
+public class MaterialInventoryController extends BaseController {
     @Autowired
     private IMaterialInventoryService materialInventoryService;
     @Autowired
@@ -55,56 +47,60 @@ public class MaterialInventoryController extends BaseController
     @Autowired
     private MaterielMapper materielMapper;
 
-
-
     /**
      * 扫码入库
      */
     @PreAuthorize("@ss.hasPermi('system:inventory:add')")
     @Log(title = "物料库存", businessType = BusinessType.INSERT)
-    @PostMapping("/inventory/insertMaterialInventory")
+    @RequestMapping(value = "/insertMaterialInventory", method = RequestMethod.POST)
     @ApiOperation(value = "新增物料库存")
-    public AjaxResult insertMaterialInventory(@RequestBody MaterialInventoryVo materialInventoryVo)
-    {
+    public AjaxResult insertMaterialInventory(@RequestBody MaterialInventoryVo materialInventoryVo) {
+        String replace = materialInventoryVo.getQtCodeNumber().replace("/r", "");
+        materialInventoryVo.setQtCodeNumber(replace);
         //1、禁止重复入库
         InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if(inboundRecords==null){
-          return  AjaxResult.success("不可以重复扫码");
+        if (inboundRecords != null) {
+            return AjaxResult.success("不可以重复扫码入库");
         }
         //2、判断是第一次入库还是第二次入库这个同类商品(这是一个连表语句)
         MaterialInventory materialInventory
                 = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
-        int count=0;
-        if(materialInventory!=null){ //证明已经入库过相同的产品了---库存叠加操作
-            String quantityOld = materialInventory.getQuantity();
-            String quantity = materialInventoryVo.getQuantity();
-            Integer newQuantity=Integer.parseInt(quantityOld)+Integer.parseInt(quantity);
-            materialInventory.setQuantity(String.valueOf(newQuantity));
+        int count = 0;
+        if (materialInventory != null) { //证明已经入库过相同的产品了---库存叠加操作
+            Double quantityOld = materialInventory.getQuantity();
+            Double quantity = materialInventoryVo.getQuantity();
+            Double newQuantity =quantityOld+quantity;
+            materialInventory.setQuantity(newQuantity);
+            materialInventory.setUpdateTime(new Date());
+            materialInventory.setUpdateById(SecurityUtils.getUserId());
             count = materialInventoryService.updateMaterialInventory(materialInventory);
-        }else{ //第一次入库走插入操作) ()
-            MaterialInventory materialInventoryObj=new MaterialInventory();
+        } else { //第一次入库走插入操作) ()
+            MaterialInventory materialInventoryObj = new MaterialInventory();
             materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
             materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
             materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
-            materialInventoryObj.setQuantity(materialInventoryObj.getQuantity());//数量
+            materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
+            materialInventoryObj.setCreateById(SecurityUtils.getUserId());
+            materialInventoryObj.setCreateTime(new Date());
             count = materialInventoryService.insertMaterialInventory(materialInventoryObj);
         }
-        if(count>0){
-            InboundRecords inboundRecords1=new InboundRecords();
+        if (count > 0) {
+            InboundRecords inboundRecords1 = new InboundRecords();
             inboundRecords1.setInboundTime(new Date());//入库时间
             //物料名称需要根据物料编码查询下
             Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
             inboundRecords1.setInboundAterialsName(materiel.getMaterielName());//物料名称
             inboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
             inboundRecords1.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
-            inboundRecords1.setInboundQuantity(materialInventoryVo.getQuantity());//入库数量
+            inboundRecords1.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
             inboundRecords1.setInboundLeader(SecurityUtils.getUsername());//仓管员
             inboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
             inboundRecords1.setCreateTime(new Date());//创建时间
+            inboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
             inboundRecordsMapper.insertInboundRecords(inboundRecords1); //插入入库日志信息
-            return  AjaxResult.success("入库成功");
+            return AjaxResult.success("入库成功");
         }
-        return AjaxResult.success("入库失败");
+        return AjaxResult.error("入库失败");
     }
 
 
@@ -113,45 +109,45 @@ public class MaterialInventoryController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:inventory:add')")
     @Log(title = "物料库存", businessType = BusinessType.INSERT)
-    @PostMapping("/inventory/deliveryFromStorage")
-    @ApiOperation(value = "新增物料库存")
-    public AjaxResult deliveryFromStorage(@RequestBody MaterialInventoryVo materialInventoryVo)
-    {
+    @RequestMapping(value = "/deliveryFromStorage",method = RequestMethod.POST)
+    @ApiOperation(value = "扫码出库")
+    public AjaxResult deliveryFromStorage(@RequestBody MaterialInventoryVo materialInventoryVo) {
         //1、禁止重复入库
         InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if(inboundRecords==null){
-            return  AjaxResult.success("此货品还没有入库,不能出库");
+        if (inboundRecords == null) {
+            return AjaxResult.error("此货品还没有入库,不能出库");
         }
         //2、是否重复入库
         OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-        if(outboundRecords==null){
-            return  AjaxResult.success("此货品不能重复出库");
+        if (outboundRecords != null) {
+            return AjaxResult.success("此货品不能重复出库");
         }
         //3、根据物料编码跟规则查询库存信息
         MaterialInventory materialInventory
                 = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
         //4、出库多少减去这个数量
-        String quantityOld = materialInventory.getQuantity();
-        String quantity = materialInventoryVo.getQuantity();
-        Integer newQuantity=Integer.parseInt(quantityOld)-Integer.parseInt(quantity);
-        materialInventory.setQuantity(String.valueOf(newQuantity));
+        Double quantityOld = materialInventory.getQuantity();
+        Double quantity = materialInventoryVo.getQuantity();
+        Double newQuantity =quantityOld-quantity;
+        materialInventory.setQuantity(newQuantity);
         int count = materialInventoryService.updateMaterialInventory(materialInventory);
-        if(count>0){
-            OutboundRecords outboundRecords1=new OutboundRecords();
+        if (count > 0) {
+            OutboundRecords outboundRecords1 = new OutboundRecords();
             outboundRecords1.setOutboundTime(new Date());//出库时间
             //物料名称需要根据物料编码查询下
             Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
             outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
+            outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
             outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
             outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
-            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity());//出库数量
+            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
             outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
             outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
             outboundRecords1.setCreateTime(new Date());//创建时间
             outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
-            return  AjaxResult.success("出库成功");
+            return AjaxResult.success("出库成功");
         }
-        return AjaxResult.success("出库失败");
+        return AjaxResult.error("出库失败");
     }
 
     /**
@@ -161,8 +157,7 @@ public class MaterialInventoryController extends BaseController
     @Log(title = "物料库存", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "新增物料库存")
-    public AjaxResult add(@RequestBody MaterialInventory materialInventory)
-    {
+    public AjaxResult add(@RequestBody MaterialInventory materialInventory) {
         return toAjax(materialInventoryService.insertMaterialInventory(materialInventory));
     }
 
@@ -172,8 +167,7 @@ public class MaterialInventoryController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:inventory:list')")
     @GetMapping("/list")
     @ApiOperation(value = "查询物料库存列表")
-    public TableDataInfo list(MaterialInventory materialInventory)
-    {
+    public TableDataInfo list(MaterialInventory materialInventory) {
         startPage();
         List<MaterialInventory> list = materialInventoryService.selectMaterialInventoryList(materialInventory);
         return getDataTable(list);
@@ -186,8 +180,7 @@ public class MaterialInventoryController extends BaseController
     @Log(title = "物料库存", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ApiOperation(value = "导出物料库存列表")
-    public void export(HttpServletResponse response, MaterialInventory materialInventory)
-    {
+    public void export(HttpServletResponse response, MaterialInventory materialInventory) {
         List<MaterialInventory> list = materialInventoryService.selectMaterialInventoryList(materialInventory);
         ExcelUtil<MaterialInventory> util = new ExcelUtil<MaterialInventory>(MaterialInventory.class);
         util.exportExcel(response, list, "物料库存数据");
@@ -199,8 +192,7 @@ public class MaterialInventoryController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:inventory:query')")
     @GetMapping(value = "/{id}")
     @ApiOperation(value = "获取物料库存详细信息")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(materialInventoryService.selectMaterialInventoryById(id));
     }
 
@@ -212,8 +204,7 @@ public class MaterialInventoryController extends BaseController
     @Log(title = "物料库存", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "修改物料库存")
-    public AjaxResult edit(@RequestBody MaterialInventory materialInventory)
-    {
+    public AjaxResult edit(@RequestBody MaterialInventory materialInventory) {
         return toAjax(materialInventoryService.updateMaterialInventory(materialInventory));
     }
 
@@ -224,8 +215,7 @@ public class MaterialInventoryController extends BaseController
     @Log(title = "物料库存", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @ApiOperation(value = "删除物料库存")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(materialInventoryService.deleteMaterialInventoryByIds(ids));
     }
 }

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/controller/OutboundRecordsController.java

@@ -31,7 +31,7 @@ import com.zkqy.common.core.page.TableDataInfo;
  * @date 2024-03-08
  */
 @RestController
-@RequestMapping("/system/records")
+@RequestMapping("/system/outBoundRecords")
 @Api(value = "/system/records", description = "出库记录-接口")
 public class OutboundRecordsController extends BaseController {
 

+ 3 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/domain/MaterialInventory.java

@@ -36,7 +36,7 @@ public class MaterialInventory extends BaseEntity
 
     /** 重量/数量 */
     @Excel(name = "重量/数量")
-    private String quantity;
+    private Double quantity;
 
     /** 仓库编号 */
     @Excel(name = "仓库编号")
@@ -110,12 +110,12 @@ public class MaterialInventory extends BaseEntity
     {
         return subordinateUnit;
     }
-    public void setQuantity(String quantity)
+    public void setQuantity(Double quantity)
     {
         this.quantity = quantity;
     }
 
-    public String getQuantity()
+    public Double getQuantity()
     {
         return quantity;
     }

+ 1 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/InboundRecordsMapper.java

@@ -3,6 +3,7 @@ package com.zkqy.business.mapper;
 import java.util.List;
 import com.zkqy.business.domain.InboundRecords;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 入库记录Mapper接口

+ 1 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/InboundRecordsServiceImpl.java

@@ -39,6 +39,7 @@ public class InboundRecordsServiceImpl implements IInboundRecordsService {
      */
     @Override
     public List<InboundRecords> selectInboundRecordsList(InboundRecords inboundRecords) {
+
         return inboundRecordsMapper.selectInboundRecordsList(inboundRecords);
     }
 

+ 3 - 1
zkqy-custom-business/src/main/resources/mapper/InboundRecordsMapper.xml → zkqy-custom-business/src/main/resources/mapper/business/InboundRecordsMapper.xml

@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectInboundRecordsVo"/>
         where id = #{id}
     </select>
-    <select id="selectInboundRecordsByQtCodeNumber" resultType="com.zkqy.business.domain.InboundRecords">
+    <select id="selectInboundRecordsByQtCodeNumber" parameterType="string" resultType="com.zkqy.business.domain.InboundRecords">
         <include refid="selectInboundRecordsVo"/>
         where qtCodeNumber = #{qtCodeNumber}
     </select>
@@ -112,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="processKey != null">process_key,</if>
             <if test="taskProcessKey != null">task_process_key,</if>
             <if test="taskNodeKey != null">task_node_key,</if>
+            <if test="qtCodeNumber != null">qtCodeNumber,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="inboundUnitName != null">#{inboundUnitName},</if>
@@ -142,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="processKey != null">#{processKey},</if>
             <if test="taskProcessKey != null">#{taskProcessKey},</if>
             <if test="taskNodeKey != null">#{taskNodeKey},</if>
+            <if test="qtCodeNumber != null">#{qtCodeNumber},</if>
          </trim>
     </insert>
 

+ 5 - 5
zkqy-custom-business/src/main/resources/mapper/MaterialInventoryMapper.xml → zkqy-custom-business/src/main/resources/mapper/business/MaterialInventoryMapper.xml

@@ -96,7 +96,7 @@
     </select>
 
     <select id="selectMaterialInventoryByMaterialCodeAndSpecifications"
-            resultMap="MaterialInventoryResultTwo">
+            resultMap="MaterialInventoryResultTwo" parameterType="string">
         select mi.id                     as id,
                mi.stock_number           as stock_number,
                mi.warehouse_entry_number as warehouse_entry_number,
@@ -115,10 +115,10 @@
                mi.del_flag               as del_flag,
                mi.task_process_key       as task_process_key,
                mi.task_node_key          as task_node_key
-        from {DBNAME}.material_inventory as mi
-               left join
-               material as m
-        on (m.materiel_code=mi.code)
+        from huaqian.material_inventory as mi
+                 left join
+             huaqian.materiel as m
+             on (m.materiel_code=mi.material_code)
         where m.materiel_code=#{materialCode}
           and m.specification_model=#{specifications}
     </select>

+ 5 - 5
zkqy-custom-business/src/main/resources/mapper/MaterielMapper.xml → zkqy-custom-business/src/main/resources/mapper/business/MaterielMapper.xml

@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMaterielVo">
-        select id, materiel_code, materiel_name, materiel_asname, subordinate_departmen, materiel_species, materiel_use, units, specification_model, status, data_approval_status, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from materiel
+        select id, materiel_code, materiel_name, materiel_asname, subordinate_departmen, materiel_species, materiel_use, units, specification_model, status, data_approval_status, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from {DBNAME}.materiel
     </sql>
 
     <select id="selectMaterielList" parameterType="com.zkqy.business.domain.Materiel" resultMap="MaterielResult">
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertMateriel" parameterType="com.zkqy.business.domain.Materiel" useGeneratedKeys="true" keyProperty="id">
-        insert into materiel
+        insert into {DBNAME}.materiel
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="materielCode != null">materiel_code,</if>
             <if test="materielName != null">materiel_name,</if>
@@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <update id="updateMateriel" parameterType="com.zkqy.business.domain.Materiel">
-        update materiel
+        update {DBNAME}.materiel
         <trim prefix="SET" suffixOverrides=",">
             <if test="materielCode != null">materiel_code = #{materielCode},</if>
             <if test="materielName != null">materiel_name = #{materielName},</if>
@@ -137,11 +137,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteMaterielById" parameterType="Long">
-        delete from materiel where id = #{id}
+        delete from {DBNAME}.materiel where id = #{id}
     </delete>
 
     <delete id="deleteMaterielByIds" parameterType="String">
-        delete from materiel where id in 
+        delete from {DBNAME}.materiel where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 5 - 5
zkqy-custom-business/src/main/resources/mapper/OutboundRecordsMapper.xml → zkqy-custom-business/src/main/resources/mapper/business/OutboundRecordsMapper.xml

@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectOutboundRecordsVo">
-        select id, outbound_no, outbound_unit_name, outbound_type, outbound_time, outbound_aterials_name, specifications, outbound_unit, outbound_quantity, outbound_unit_price, outbound_amounts, outbound_notes, outbound_leader, warehouse_no, accounting, handled_by, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from outbound_records
+        select id, outbound_no, outbound_unit_name, outbound_type, outbound_time, outbound_aterials_name, specifications, outbound_unit, outbound_quantity, outbound_unit_price, outbound_amounts, outbound_notes, outbound_leader, warehouse_no, accounting, handled_by, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key,qtCodeNumber from {DBNAME}.outbound_records
     </sql>
 
     <select id="selectOutboundRecordsList" parameterType="com.zkqy.business.domain.OutboundRecords" resultMap="OutboundRecordsResult">
@@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertOutboundRecords" parameterType="com.zkqy.business.domain.OutboundRecords" useGeneratedKeys="true" keyProperty="id">
-        insert into outbound_records
+        insert into {DBNAME}.outbound_records
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="outboundNo != null">outbound_no,</if>
             <if test="outboundUnitName != null">outbound_unit_name,</if>
@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <update id="updateOutboundRecords" parameterType="com.zkqy.business.domain.OutboundRecords">
-        update outbound_records
+        update {DBNAME}.outbound_records
         <trim prefix="SET" suffixOverrides=",">
             <if test="outboundNo != null">outbound_no = #{outboundNo},</if>
             <if test="outboundUnitName != null">outbound_unit_name = #{outboundUnitName},</if>
@@ -162,11 +162,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteOutboundRecordsById" parameterType="Long">
-        delete from outbound_records where id = #{id}
+        delete from {DBNAME}.outbound_records where id = #{id}
     </delete>
 
     <delete id="deleteOutboundRecordsByIds" parameterType="String">
-        delete from outbound_records where id in 
+        delete from {DBNAME}.outbound_records where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>