xuhy
2024-09-10 993c89754d492a684108839ecba56fe8ca5b160f
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
<?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.system.mapper.TOrderMealGoodsMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TOrderMealGoods">
        <id column="id" property="id" />
        <result column="goodsNum" property="goodsNum" />
        <result column="goodsName" property="goodsName" />
        <result column="goodsSalePrice" property="goodsSalePrice" />
        <result column="goodsPicture" property="goodsPicture" />
        <result column="goodsCount" property="goodsCount" />
        <result column="orderId" property="orderId" />
        <result column="typeName" property="typeName" />
        <result column="costPrice" property="costPrice" />
        <result column="typeId" property="typeId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, goodsNum, goodsName, goodsSalePrice, goodsPicture, goodsCount, orderId,typeName,costPrice,typeId
    </sql>
    <select id="costTotal" resultType="java.math.BigDecimal">
        select sum(costPrice) from t_order_meal_goods
        <where>
            <if test="ids != null and ids.size()>0">
                AND orderId IN
                <foreach collection="ids" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>
 
</mapper>