|
|
@@ -0,0 +1,60 @@
|
|
|
+<?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.ruoyi.wms.mapper.WmsFinishedProductCostMapper">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.ruoyi.wms.domain.entity.WmsFinishedProductCost">
|
|
|
+ <id property="id" column="id" />
|
|
|
+ <result property="taskId" column="task_id" />
|
|
|
+ <result property="versionId" column="version_id" />
|
|
|
+ <result property="itemSkuId" column="item_sku_id" />
|
|
|
+ <result property="materialCost" column="material_cost" />
|
|
|
+ <result property="packagingCost" column="packaging_cost" />
|
|
|
+ <result property="totalCost" column="total_cost" />
|
|
|
+ <result property="quantity" column="quantity" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,task_id,version_id,item_sku_id,material_cost,packaging_cost,
|
|
|
+ total_cost,quantity
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="finishedProduct" resultType="com.ruoyi.wms.domain.vo.WmsFinishedProductCostVo">
|
|
|
+ select wi.item_code,
|
|
|
+ wi.item_name,
|
|
|
+ wi.item_brand,
|
|
|
+ wis.sku_name,
|
|
|
+ wis.sku_code,
|
|
|
+ wfpc.material_cost,
|
|
|
+ wfpc.packaging_cost,
|
|
|
+ wfpc.total_cost,
|
|
|
+ wfpc.quantity
|
|
|
+ from wms_finished_product_cost wfpc
|
|
|
+ left join wms_task wt on wfpc.task_id = wt.id
|
|
|
+ left join wms_bom_item wbi on wfpc.version_id = wbi.version_id
|
|
|
+ left join wms_item_sku wis on wfpc.item_sku_id = wis.id
|
|
|
+ left join wms_item wi on wis.item_id = wi.id
|
|
|
+ <where>
|
|
|
+ <if test='costDto.taskCode != null and costDto.taskCode != ""'>
|
|
|
+ and wt.task_code = #{costDto.taskCode}
|
|
|
+ </if>
|
|
|
+ <if test='costDto.itemName != null and costDto.itemName != ""'>
|
|
|
+ AND wi.item_name = #{costDto.itemName}
|
|
|
+ </if>
|
|
|
+ <if test='costDto.itemCode != null and costDto.itemCode != ""'>
|
|
|
+ AND wi.item_code = = #{costDto.itemCode}
|
|
|
+ </if>
|
|
|
+ <if test='costDto.skuName != null and costDto.skuName != ""'>
|
|
|
+ AND wis.sku_name = = #{costDto.skuName}
|
|
|
+ </if>
|
|
|
+ <if test='costDto.versionId != null and costDto.versionId != ""'>
|
|
|
+ AND wfpc.version_id = = #{costDto.versionId}
|
|
|
+ </if>
|
|
|
+ <if test="costDto.startDate != null and costDto.endDate != null">
|
|
|
+ and wfpc.create_time > CONCAT(#{costDto.startDate}, " 00:00:00")
|
|
|
+ and wfpc.create_time <= CONCAT(#{costDto.endDate}, " 23.59.59")
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+</mapper>
|