<?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.demo.mapper.PlanItemMapper">
    <select id="selectEquipmentCountByPlanId" resultType="java.lang.Integer">
        SELECT
            COUNT(*)
        FROM
            `dl_plan_item`
        WHERE
            plan_id = #{planId}
        GROUP BY
            plan_id;
    </select>

    <select id="getEuipmentPlanList" resultType="com.ruoyi.demo.entity.bo.PlanItemBo">
        select
            item_id,dl_plan.plan_id,commercial_id,commercial_name,appkey,app_name,goods_id,goods_img,goods_name,goods_logo,goods_introduce,goods_price,goods_classify,sort,dl_plan_item.deleted
        from dl_plan,dl_plan_item
            ${ew.customSqlSegment}
    </select>

    <select id="getEuipmentPlanCont" resultType="java.lang.Integer">
        select count(*)
        from dl_plan,dl_plan_item
            ${ew.customSqlSegment}
    </select>
    <select id="getItemIdsByCode" resultType="java.lang.String">
        SELECT DISTINCT
            item_id
        FROM
            `dl_plan_item`
        WHERE equipment_code = #{equipmentCode};
    </select>
</mapper>
