| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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="cn.iocoder.yudao.module.order.dal.mysql.ShippingPlanMapper">
- <!-- 根据ID查询出货计划(忽略租户) -->
- <select id="selectByRecId" resultType="cn.iocoder.yudao.module.order.dal.dataobject.ShippingPlanDO">
- SELECT
- RecID as recId,
- Domain as domain,
- LotSerial as lotSerial,
- Remark as remark,
- ShippingSite as shippingSite,
- Status as status,
- CreateUser as createUser,
- UpdateUser as updateUser,
- CreateTime as createTime,
- UpdateTime as updateTime,
- IsActive as isActive,
- IsConfirm as isConfirm,
- Priority as priority,
- ShippingDate as shippingDate,
- ShippingAddress as shippingAddress,
- Consignee as consignee,
- Telephone as telephone
- FROM ShippingPlan
- WHERE RecID = #{id}
- </select>
- <!-- 出货计划列表查询 - 根据需求文档提供的SQL -->
- <select id="selectShippingPlanList" resultType="cn.iocoder.yudao.module.order.controller.admin.delivery.vo.ShippingPlanListItemVO">
- SELECT
- a.ShippingSite,
- a.lotserial,
- a.ShippingDate,
- a.ShippingAddress,
- a.Consignee,
- a.Telephone,
- a.recid as id,
- b.OrdNbr,
- b.bill_no,
- b.OrdDate,
- b.Country,
- b.CustomNo,
- b.CustomName,
- b.ItemNum,
- b.ItemName,
- b.Specification,
- b.Qty,
- b.Packaging,
- c.RecID,
- b.RecID as sid,
- b.Volume,
- b.Weight
- FROM ShippingPlan a
- LEFT JOIN ShippingPlanDetail b ON a.recid = b.plan_id
- LEFT JOIN ASNBOLShipperDetail c ON b.itemnum = c.ContainerItem
- AND b.bill_no = c.ordnbr
- AND c.shtype = 'SH'
- AND c.Typed <> 'S'
- AND c.IsActive = 1
- WHERE 1=1
- <if test="req.lotSerial != null and req.lotSerial != ''">
- AND a.LotSerial LIKE CONCAT('%', #{req.lotSerial}, '%')
- </if>
- <if test="req.status != null and req.status != ''">
- AND a.Status = #{req.status}
- </if>
- <if test="req.consignee != null and req.consignee != ''">
- AND a.Consignee LIKE CONCAT('%', #{req.consignee}, '%')
- </if>
- <if test="req.ordNbr != null and req.ordNbr != ''">
- AND b.OrdNbr LIKE CONCAT('%', #{req.ordNbr}, '%')
- </if>
- <if test="req.billNo != null and req.billNo != ''">
- AND b.bill_no LIKE CONCAT('%', #{req.billNo}, '%')
- </if>
- <if test="req.country != null and req.country != ''">
- AND b.Country = #{req.country}
- </if>
- <if test="req.shippingDate != null and req.shippingDate != ''">
- AND DATE(a.ShippingDate) = #{req.shippingDate}
- </if>
- <if test="req.customNo != null and req.customNo != ''">
- AND b.CustomNo LIKE CONCAT('%', #{req.customNo}, '%')
- </if>
- <if test="req.itemNum != null and req.itemNum != ''">
- AND b.ItemNum LIKE CONCAT('%', #{req.itemNum}, '%')
- </if>
- ORDER BY a.CreateTime DESC
- </select>
- </mapper>
|