zss
2023-08-15 56f89b4a45a561ff017ffd1e611e542130d046a0
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
47
48
49
50
51
52
53
54
55
56
57
58
<?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">
    <select id="selectSaleList" resultType="java.util.Map">
        select id,
        order_number,
        code,
        name,
        proname,
        type,
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期'
        from mom_ocean.sale
        where state=1
        <if test="orderNumber!=null and orderNumber!=''">
            and order_number like concat('%',#{orderNumber},'%')
        </if>
        <if test="name!=null and name!=''">
            and name LIKE CONCAT('%',#{name},'%')
        </if>
        <if test="type!=null and type!=''">
            and type=#{type}
        </if>
        <if test="delTime!=null and delTime!=''">
            and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime}
        </if>
        order by id desc
    </select>
 
    <!--查询订单BOM列表-->
    <select id="selectAllOrder" resultType="java.util.Map">
        select s.id ,
            order_number,
            saleman,
            proname,
            sm.name,
            specifications,
            unit,
            number,
            DATE_FORMAT(s.create_time, '%Y-%m-%d') '下单日期',
            DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期',
            bianzhi_state
            from mom_ocean.sale s ,mom_ocean.sale_material sm
        where s.id=sm.sale_id
        and s.state=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 state!=''">
            and bianzhi_state=#{state}
        </if>
        <if test="time!=null and time!=''">
            and s.create_time=#{time}
        </if>
    </select>
</mapper>