From 2777f69fbf5565f4caf275b8134737e333e407fc Mon Sep 17 00:00:00 2001
From: 张磊磊 <201175954@qq.com>
Date: 星期四, 30 十一月 2023 15:34:56 +0800
Subject: [PATCH] 原料库存统计thingjs/料仓增删改查

---
 hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml |  312 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 312 insertions(+), 0 deletions(-)

diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml
index 55cbeb7..ea28f6e 100644
--- a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml
+++ b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml
@@ -711,4 +711,316 @@
         types=2
         where weighbridge_id=#{weighbridgeId}
     </update>
+
+    <select id="materialStockInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MaterialStockRecordDto">
+    SELECT
+	s.dict_name AS materialName,
+	t.material_value AS materialValue
+FROM
+	t_material_stock t
+	LEFT JOIN sys_dict s ON t.material_name = s.dict_id
+    </select>
+    <select id="steelInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.SteelDto">
+        select
+         steel_name as steelName,
+         steel_model as steelModel,
+         stock as stock
+         from sys_steel
+    </select>
+    <select id="assistGoodInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.AssistGoodDto">
+        select s.assist_name as s.assistName,
+        d.dict_name as assistType,
+        s.stock as stock
+         from  sys_assist_good s left join sys_dict d on  s.assist_type=d.dict_id
+    </select>
+    <select id="mouldInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MouldDto">
+        select
+         mould_num as mouldNum,
+         free as free,
+         current_cycle_time as currentCycleTime
+         from sys_mould
+    </select>
+    <select id="steelType" resultType="com.thhy.materials.modules.biz.concret.entity.SysSteel">
+        select
+         steel_id as steelId,
+         steel_name as steelName,
+         steel_model as steelModel,
+         stock as stock
+         from
+            sys_steel
+    </select>
+    <insert id="steelRecordIn" >
+        insert into sys_steel_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="steelId != null">
+                steel_id,
+            </if>
+            <if test="stockType != null">
+                stock_type,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="changeStock != null">
+                change_stock,
+            </if>
+            <if test="supplierId != null">
+                supplier_id,
+            </if>
+            <if test="factoryName != null">
+                factory_name,
+            </if>
+            <if test="brand != null">
+                brand,
+            </if>
+            <if test="lineCode != null">
+                line_code,
+            </if>
+            <if test="proId != null">
+                pro_id,
+            </if>
+            <if test="createUser != null">
+                create_user,
+            </if>
+            <if test="companyId != null">
+                company_id,
+            </if>
+            <if test="carName != null">
+                car_name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=VARCHAR},
+            </if>
+            <if test="steelId != null">
+                #{steelId,jdbcType=VARCHAR},
+            </if>
+            <if test="stockType != null">
+                #{stockType,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="changeStock != null">
+                #{changeStock,jdbcType=DOUBLE},
+            </if>
+            <if test="supplierId != null">
+                #{supplierId,jdbcType=VARCHAR},
+            </if>
+            <if test="factoryName != null">
+                #{factoryName,jdbcType=VARCHAR},
+            </if>
+            <if test="brand != null">
+                #{brand,jdbcType=VARCHAR},
+            </if>
+            <if test="lineCode != null">
+                #{lineCode,jdbcType=VARCHAR},
+            </if>
+            <if test="proId != null">
+                #{proId,jdbcType=VARCHAR},
+            </if>
+            <if test="createUser != null">
+                #{createUser,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null">
+                #{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="carName != null">
+                #{carName,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="steelUp" >
+        update sys_steel set
+        stock=#{doubleValue}
+        where steel_id=#{steelId}
+    </update>
+
+    <select id="materialWarehouseRecordList" resultType="com.thhy.materials.modules.biz.weigh.entity.TSuMaterialWarehouseRecord">
+        select
+        id,
+        table_num as tableNum,
+        name_of_origin as nameOfOrigin,
+        material_name as materialName,
+        incoming_quantity as incomingQuantity,
+        in_time as inTime,
+        status as status,
+        inspection_date as inspectionDate,
+        report_number as reportNumber,
+        create_time as createTime,
+        `type`
+         from t_su_material_warehouse_record
+        where 1=1
+        <if test="tableNum!=null and tableNum!='' ">
+            and table_num=#{tableNum}
+        </if>
+        <if test="type!=null and type!='' ">
+            and `type`=#{type}
+        </if>
+        <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' ">
+            and create_time between #{strTime} and #{endTime}
+        </if>
+        order by create_time desc
+    </select>
+    <insert id="materialWarehouseRecordInsert" >
+        insert into t_su_material_warehouse_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="tableNum != null">
+                table_num,
+            </if>
+            <if test="nameOfOrigin != null">
+                name_of_origin,
+            </if>
+            <if test="materialName != null">
+                material_name,
+            </if>
+            <if test="incomingQuantity != null">
+                incoming_quantity,
+            </if>
+            <if test="inTime != null">
+                in_time,
+            </if>
+            <if test="status != null">
+                status,
+            </if>
+            <if test="inspectionDate != null">
+                inspection_date,
+            </if>
+            <if test="reportNumber != null">
+                report_number,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="createUser != null">
+                create_user,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="updateUser != null">
+                update_user,
+            </if>
+            <if test="isUse != null">
+                is_use,
+            </if>
+            <if test="companyId != null">
+                company_id,
+            </if>
+            <if test="type != null">
+                type,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=VARCHAR},
+            </if>
+            <if test="tableNum != null">
+                #{tableNum,jdbcType=INTEGER},
+            </if>
+            <if test="nameOfOrigin != null">
+                #{nameOfOrigin,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="incomingQuantity != null">
+                #{incomingQuantity,jdbcType=DOUBLE},
+            </if>
+            <if test="inTime != null">
+                #{inTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=INTEGER},
+            </if>
+            <if test="inspectionDate != null">
+                #{inspectionDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="reportNumber != null">
+                #{reportNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="createUser != null">
+                #{createUser,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUser != null">
+                #{updateUser,jdbcType=VARCHAR},
+            </if>
+            <if test="isUse != null">
+                #{isUse,jdbcType=INTEGER},
+            </if>
+            <if test="companyId != null">
+                #{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                #{type,jdbcType=INTEGER},
+            </if>
+        </trim>
+    </insert>
+    <update id="materialWarehouseRecordUpdate" >
+        update t_su_material_warehouse_record
+        <set>
+            <if test="tableNum != null">
+                table_num = #{tableNum,jdbcType=INTEGER},
+            </if>
+            <if test="nameOfOrigin != null">
+                name_of_origin = #{nameOfOrigin,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                material_name = #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="incomingQuantity != null">
+                incoming_quantity = #{incomingQuantity,jdbcType=DOUBLE},
+            </if>
+            <if test="inTime != null">
+                in_time = #{inTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="status != null">
+                status = #{status,jdbcType=INTEGER},
+            </if>
+            <if test="inspectionDate != null">
+                inspection_date = #{inspectionDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="reportNumber != null">
+                report_number = #{reportNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="createUser != null">
+                create_user = #{createUser,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUser != null">
+                update_user = #{updateUser,jdbcType=VARCHAR},
+            </if>
+            <if test="isUse != null">
+                is_use = #{isUse,jdbcType=INTEGER},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type = #{type,jdbcType=INTEGER},
+            </if>
+        </set>
+        where id = #{id,jdbcType=VARCHAR}
+    </update>
+    <delete id="materialWarehouseRecordDel" parameterType="java.lang.String">
+        delete from t_su_material_warehouse_record where id=#{id}
+    </delete>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3