zss
2023-09-20 608fa275864c7cb4353e5e030e4a1304e56529ac
inventory-server/src/main/resources/mapper/SaleMapper.xml
@@ -1,6 +1,12 @@
<?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.yuanchu.mom.mapper.SaleMapper">
    <!--批量删除-->
    <update id="delAllSale">
        update mom_ocean.sale
        set state=0
        where id in (${ids})
    </update>
    <select id="selectSaleList" resultType="java.util.Map">
        select id,
        order_number,
@@ -8,7 +14,8 @@
        name,
        proname,
        type,
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期'
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期',
        note
        from mom_ocean.sale
        where state=1
        <if test="orderNumber!=null and orderNumber!=''">
@@ -28,7 +35,7 @@
    <!--查询订单BOM列表-->
    <select id="selectAllOrder" resultType="java.util.Map">
        select s.id ,
        select sm.id,
        order_number,
        saleman,
        proname,
@@ -36,24 +43,26 @@
        specifications,
        unit,
        number,
        note,
        DATE_FORMAT(s.create_time, '%Y-%m-%d') '下单日期',
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期',
        bianzhi_state
        sm.type
        from mom_ocean.sale s ,mom_ocean.sale_material sm
        where s.id=sm.sale_id
        and s.state=1
        and bianzhi_state!=2
        and s.type=1
        <if test="orderCode!=null and orderCode!=''">
            and order_number like concat('%',#{orderCode},'%')
        </if>
        <if test="name!=null and name!=''">
            and sm.name like concat('%',#{name},'%')
        </if>
        <if test="state!=null ">
            and bianzhi_state=#{state}
        <if test="type!=null ">
            and sm.type=#{type}
        </if>
        <if test="time!=null and time!=''">
            and s.create_time=#{time}
        </if>
        order by delTime
    </select>
</mapper>