XiaoRuby
2023-08-11 7b09f233bde70508f6db7e08e983e9a2c4bb3e99
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
<?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.OrdersMapper">
    <select id="selectAllOrder" resultType="java.util.Map">
        select o.id,
        order_code,
        department,
        province,
        salesman,
        proname,
        m.name,
        specifications,
        o.type,
        unit,
        number,
        DATE_FORMAT(o.create_time, '%Y-%m-%d') ,
        DATE_FORMAT(delivery_time, '%Y-%m-%d'),
        o.state
        from mom_ocean.orders o,mom_ocean.material m
        <where>
            <if test="orderCode != null and orderCode!=''">
                and order_code LIKE CONCAT('%',#{orderCode},'%')
            </if>
            <if test="time != null and time!=''">
                and o.create_time = #{time}
            </if>
            <if test="name != null and name!=''">
                and m.name LIKE CONCAT('%',#{name},'%')
            </if>
            <if test="state != null and state!=''">
                and o.state = #{state}
            </if>
            and o.code=m.code
        </where>
        order by o.id desc
    </select>
</mapper>