rentaiming
2024-07-08 8e6989e09a2cc4046fd6985b18f715f98f45e1c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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.management.mapper.SlVolumeProductionRkMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.management.domain.SlVolumeProductionRk">
        <id column="id" property="id" />
        <result column="materials_id" property="materialsId" />
        <result column="rk_num" property="rkNum" />
        <result column="rk_model" property="rkModel" />
        <result column="rk_pice" property="rkPice" />
        <result column="store_management_number" property="storeManagementNumber" />
        <result column="shelf_id" property="shelfId" />
        <result column="del_flag" property="delFlag" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="supplier_id" property="supplierId" />
        <result column="attachment" property="attachment" />
        <result column="source" property="source" />
        <result column="remark" property="remark" />
        <result column="state" property="state" />
    </resultMap>
 
    <select id="getManagementInventoryList" resultType="java.lang.Integer">
        SELECT ifnull(COUNT(*), 0) FROM sl_volume_production_rk sl
        WHERE
            sl.management_id = #{id}
            AND sl.del_flag=0
        GROUP BY sl.materials_id
 
    </select>
 
    <select id="getStoreManagementGoodSmaterialsOne" resultType="java.lang.Double">
        SELECT ifnull(ROUND(AVG(sl.rk_pice),2), 0.0) FROM sl_volume_production_rk sl
        WHERE
            sl.materials_id = #{id}
          AND sl.del_flag=0
        GROUP BY sl.materials_id
 
    </select>
 
 
 
</mapper>