zss
2023-08-10 e8a75a44bdc130e8b162351c3c94c01f3d8ada5e
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
59
60
61
62
63
<?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.InspectUnacceptedMapper">
    <select id="selectUnRawInspectsList" resultType="java.util.Map">
        select
        DATE_FORMAT(form_time, '%Y-%m-%d') '来料日期',
        reason,
        code,
        name,
        specifications,
        unit,
        number,
        DATE_FORMAT(ri.create_time, '%Y-%m-%d') '报检日期',
        user_name,
        DATE_FORMAT(ins_time, '%Y-%m-%d') '检验日期',
        deal_state,
        deal_reasult,
        DATE_FORMAT(deal_time, '%Y-%m-%d') '处理日期'
        from mom_ocean.raw_inspect ri inner join mom_ocean.inspect_unaccepted ru on ri.id = ru.raw_inspect_id
        <where>
        <if test="dealState!=null and dealState!=''">
           and deal_state=#{dealState}
        </if>
        <if test="formTime!=null and formTime!=''">
            and form_time=#{formTime}
        </if>
        <if test="type!=null and type!=''">
            and ru.type=#{type}
        </if>
        and ru.state=1
        </where>
    </select>
    <select id="selectInsList" resultType="java.util.Map">
        select DATE_FORMAT(fi.create_time, '%Y-%m-%d') '来料日期',
        reason,
        material_code,
        name,
        specifications_model,
        unit,
        quantity,
        DATE_FORMAT(fi.create_time, '%Y-%m-%d') '报检日期',
        u.name,
        DATE_FORMAT(fi.update_time, '%Y-%m-%d') '检验日期',
        deal_state,
        deal_reasult,
        DATE_FORMAT(deal_time, '%Y-%m-%d') '处理日期'
        from mom_ocean.inspect_unaccepted ru,
        mom_ocean.finished_inspect fi ,
        mom_ocean.user u
        where fi.id = ru.raw_inspect_id
        and fi.user_id=u.id
        <if test="dealState!=null and dealState!=''">
            and deal_state=#{dealState}
        </if>
        <if test="formTime!=null and formTime!=''">
            and fi.create_time=#{formTime}
        </if>
        <if test="type!=null and type!=''">
            and ru.type=#{type}
        </if>
        and ru.state=1
    </select>
</mapper>