李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
<?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.chinaztt.mes.warehouse.mapper.DeliveryDetailMapper">
 
    <resultMap id="deliveryDetailMap" type="com.chinaztt.mes.warehouse.dto.DeliveryDetailDTO">
        <id property="id" column="id"/>
        <result property="receivingMainId" column="receiving_main_id"/>
        <result property="partId" column="part_id"/>
        <result property="partBatchNo" column="part_batch_no"/>
        <result property="deliveryQty" column="delivery_qty"/>
        <result property="receiveQty" column="receive_qty"/>
        <result property="differenceQty" column="difference_qty"/>
        <result property="partNo" column="part_no"/>
        <result property="partName" column="part_name"/>
        <result property="materialType" column="material_type"/>
    </resultMap>
 
    <select id="getDeliveryDetailPage" resultMap="deliveryDetailMap">
        select wdd.*,
        bp.part_no,bp.part_name,bp.material_type,bp.unit
        from warehouse_delivery_detail wdd
        left join basic_part bp on wdd.part_id=bp."id"
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>
 
    <select id="getDeliveryDetailById" resultMap="deliveryDetailMap">
        select wdd.*,
        bp.part_no,bp.part_name,bp.material_type
        from warehouse_delivery_detail wdd
        left join basic_part bp on wdd.part_id=bp."id"
        where wdd.id=#{id}
    </select>
 
    <select id="auditDeliveryDetail" resultType="com.chinaztt.mes.warehouse.entity.DeliveryDetail">
        select * from warehouse_delivery_detail where receiving_main_id=#{mainId}
        and (difference_qty!=0 or difference_qty is null)
    </select>
    <select id="auditDelivery" resultType="com.chinaztt.mes.warehouse.entity.DeliveryDetail">
         select * from warehouse_delivery_detail where receiving_main_id=#{mainId}
        and (receive_qty=0 or receive_qty is null)
    </select>
</mapper>