xuhy
2025-09-05 bde85e957a1034ebee0edd1e4d440c0dfbdcfe19
ruoyi-system/src/main/resources/mapper/system/TErpGoodsMapper.xml
@@ -37,7 +37,20 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, supplier_clinic_id, goods_source, goods_name, goods_id_code, quasi_number, manufacturer, formulation_spec, packing_spec, type_id, goods_yards, maintenance_interval, low_purchase_quantity, low_unit_id, is_prescription_drug, goods_spec, warning_inventory, sales_amount, packing_unit_id, instructions_use, side_effect, clinic_purchase_price, platform_commission_price, create_time, update_time, create_by,`state`, update_by, disabled
        id, supplier_clinic_id, goods_source, goods_name, goods_id_code, quasi_number, manufacturer, formulation_spec, packing_spec, type_id, goods_yards, maintenance_interval, low_purchase_quantity, low_unit_id, is_prescription_drug, goods_spec, warning_inventory, sales_amount, packing_unit_id, instructions_use, side_effect, clinic_purchase_price, platform_commission_price, create_time, update_time, create_by,`state`, update_by, disabled,
          simplified_code,
dosage_form,
usage_classification,
product_brand,
place_of_origin,
ingredient,
trait,
indication,
taboo,
precautions,
interaction,
storage
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TErpGoodsVO">
        select <include refid="Base_Column_List"/>
@@ -65,5 +78,31 @@
        </if>
        order by create_time desc
    </select>
    <select id="listExport" resultType="com.ruoyi.system.vo.TErpGoodsVO">
        select <include refid="Base_Column_List"/>
        from t_erp_goods where disabled = 0
        <if test="query.goodsName != null and query.goodsName != ''">
            and goods_name like concat('%',#{query.goodsName},'%')
        </if>
        <if test="query.goodsIdCode != null and query.goodsIdCode != ''">
            and goods_id_code like concat('%',#{query.goodsIdCode},'%')
        </if>
        <if test="query.typeId != null and query.typeId != ''">
            and type_id = #{query.typeId}
        </if>
        <if test="query.quasiNumber != null and query.quasiNumber != ''">
            and quasi_number like concat('%',#{query.quasiNumber},'%')
        </if>
        <if test="query.state != null ">
            and state = #{query.state}
        </if>
        <if test="user.roleType != null and user.roleType == 4 ">
            and goods_source =1 and supplier_clinic_id =#{user.userId}
        </if>
        <if test="user.roleType != null and user.roleType == 5 ">
            and goods_source =2 and supplier_clinic_id =#{user.userId}
        </if>
        order by create_time desc
    </select>
</mapper>