From 5bd5f3bcd6d2cb375feb0756505691b551339716 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期五, 23 十二月 2022 08:55:23 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into zf

---
 equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml |   94 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)

diff --git a/equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml b/equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml
new file mode 100644
index 0000000..aa2f361
--- /dev/null
+++ b/equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml
@@ -0,0 +1,94 @@
+<?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.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsInfoRepository">
+
+    <resultMap type="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsInfo" id="resultMap">
+        <id column="id" property="id" jdbcType="BIGINT"/>
+        <result column="material_name" property="materialName" jdbcType="VARCHAR"/>
+        <result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
+        <result column="rfid" property="rfid" jdbcType="VARCHAR"/>
+        <result column="revert_status" property="revertStatus" jdbcType="TINYINT"/>
+        <result column="material_status" property="materialStatus" jdbcType="TINYINT"/>
+        <result column="smd_id" property="smdId" jdbcType="BIGINT"/>
+        <result column="receive_uid" property="receiveUid" jdbcType="BIGINT"/>
+        <result column="receive_uname" property="receiveUname" jdbcType="VARCHAR"/>
+        <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP"/>
+        <result column="receive_base_id" property="receiveBaseId" jdbcType="BIGINT"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="revert_time" property="revertTime" jdbcType="TIMESTAMP"/>
+
+    </resultMap>
+    <select id="getRecordBySmdId" resultType="com.gkhy.safePlatform.equipment.entity.MaterialDeliveryRecordDO">
+        select
+            r.id as receiveId,
+            r.material_name,
+            r.rfid,
+            r.smd_id,
+            b.id as receiveBaseId,
+            b.revert_count,
+            b.receive_count,
+            b.receive_uid,
+            b.status,
+            b.receive_uname,
+            b.create_time as receiveTime
+        from material_receive_records r
+        inner join material_receive_records_base b
+        on r.receive_base_id = b.id
+        where r.smd_id = #{smdId}
+        and r.revert_status = #{revertStatus}
+    </select>
+    <select id="getNoReturnRecordByIds" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO">
+        SELECT
+            r.id ,
+            r.material_name,
+            r.rfid,
+            r.smd_id,
+            r.material_status,
+            r.revert_status,
+            r.receive_uid,
+            r.receive_uname,
+            r.receive_time,
+            r.remark,
+            r.revert_time,
+            s.valid_status
+        FROM
+            material_receive_records r
+                INNER JOIN safe_material_detail s ON r.smd_id = s.id
+        WHERE
+            r.id in
+            <foreach collection="idList" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+          and r.revert_status = #{revertStatus}
+    </select>
+    <select id="getReceiveRecordsByReceiveUids" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO">
+        SELECT
+            r.id,
+            r.material_no,
+            r.material_name,
+            r.rfid,
+            r.receive_uid,
+            r.receive_uname,
+            r.smd_id,
+            d.small_classify_id,
+            d.big_classify_id,
+            d.consumable,
+            c.material_classify_name as bigClassifyName
+        FROM
+            material_receive_records r
+                LEFT JOIN safe_material_detail d ON r.smd_id = d.id
+            LEFT JOIN safe_material_classify c on d.big_classify_id = c.id
+        where r.revert_status = 1 and r.receive_uid in
+        <foreach collection="receiveUids" item="receiveUid" separator="," open="(" close=")">
+            #{receiveUid}
+        </foreach>
+         and d.small_classify_id in
+        <foreach collection="smallClassifyIds" item="smallClassifyId" separator="," open="(" close=")">
+            #{smallClassifyId}
+        </foreach>
+    </select>
+
+
+</mapper>

--
Gitblit v1.9.2