|
|
@ -253,7 +253,7 @@ |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
lds.id id, |
|
|
|
lds.id id, |
|
|
|
lds.signee_name signeeName, |
|
|
|
lds.signee_name signeeName, |
|
|
|
ldr.mall_name shoppingName, |
|
|
|
ldr.mall_name mallName, |
|
|
|
lddl.warehouse_name warehouseName, |
|
|
|
lddl.warehouse_name warehouseName, |
|
|
|
ldr.stock_article_id stockArticleId, |
|
|
|
ldr.stock_article_id stockArticleId, |
|
|
|
ldr.store_name storeName, |
|
|
|
ldr.store_name storeName, |
|
|
@ -262,6 +262,8 @@ |
|
|
|
lds.delivery_time deliveryTime, |
|
|
|
lds.delivery_time deliveryTime, |
|
|
|
lds.signing_time signingTime, |
|
|
|
lds.signing_time signingTime, |
|
|
|
lds.sjsigning_time sjsigningTime, |
|
|
|
lds.sjsigning_time sjsigningTime, |
|
|
|
|
|
|
|
lds.signing_status signingStatus, |
|
|
|
|
|
|
|
lds.signing_type signingType, |
|
|
|
lddl.train_number trainNumber, |
|
|
|
lddl.train_number trainNumber, |
|
|
|
lds.received_quantity receivedQuantity, |
|
|
|
lds.received_quantity receivedQuantity, |
|
|
|
ldr.delivery_phone deliveryPhone, |
|
|
|
ldr.delivery_phone deliveryPhone, |
|
|
@ -285,8 +287,8 @@ |
|
|
|
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id |
|
|
|
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id |
|
|
|
<where> |
|
|
|
<where> |
|
|
|
lds.is_deleted = 0 |
|
|
|
lds.is_deleted = 0 |
|
|
|
<if test="param.shoppingName != null and param.shoppingName!=''"> |
|
|
|
<if test="param.mallName != null and param.mallName!=''"> |
|
|
|
and ldr.mall_name like concat('%',#{param.shoppingName},'%') |
|
|
|
and ldr.mall_name like concat('%',#{param.mallName},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
and date_format(lds.delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
|
and date_format(lds.delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
@ -348,47 +350,45 @@ |
|
|
|
select COALESCE(COUNT(*), 0) from logpm_distribution_signfor |
|
|
|
select COALESCE(COUNT(*), 0) from logpm_distribution_signfor |
|
|
|
<where> |
|
|
|
<where> |
|
|
|
is_deleted = 0 and driver_signing ='1' |
|
|
|
is_deleted = 0 and driver_signing ='1' |
|
|
|
<if test="param.number != null and param.number!=''"> |
|
|
|
<if test="param.mallName != null and param.mallName!=''"> |
|
|
|
and number like concat('%',#{param.number},'%') |
|
|
|
and ldr.mall_name like concat('%',#{param.mallName},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.shoppingName != null and param.shoppingName!=''"> |
|
|
|
|
|
|
|
and shopping_name like concat('%',#{param.shoppingName},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.signingStatus != null and param.signingStatus!=''"> |
|
|
|
|
|
|
|
and signing_status = #{param.signingStatus} |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
and date_format(delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
|
and date_format(lds.delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.signingTime!=null and param.signingTime!=''"> |
|
|
|
<if test="param.signingTime!=null and param.signingTime!=''"> |
|
|
|
and date_format(signing_time,'%y%m%d%') = date_format(#{param.signingTime},'%y%m%d%') |
|
|
|
and date_format(lds.signing_time,'%y%m%d%') = date_format(#{param.signingTime},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.sjsigningTime!=null and param.sjsigningTime!=''"> |
|
|
|
<if test="param.sjsigningTime!=null and param.sjsigningTime!=''"> |
|
|
|
and date_format(sjsigning_time,'%y%m%d%') = date_format(#{param.sjsigningTime},'%y%m%d%') |
|
|
|
and date_format(lds.sjsigning_time,'%y%m%d%') = date_format(#{param.sjsigningTime},'%y%m%d%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.createTime_query!=null and param.createTime_query!=''"> |
|
|
|
|
|
|
|
and date_format(lds.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.orderId != null and param.orderId!=''"> |
|
|
|
<if test="param.stockArticleId != null and param.stockArticleId!=''"> |
|
|
|
and order_id like concat('%',#{param.orderId},'%') |
|
|
|
and ldr.stock_article_id like concat('%',#{param.stockArticleId},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.consignee != null and param.consignee!=''"> |
|
|
|
<if test="param.consignee != null and param.consignee!=''"> |
|
|
|
and consignee like concat('%',#{param.consignee},'%') |
|
|
|
and ldr.consignee like concat('%',#{param.consignee},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryType != null and param.deliveryType!=''"> |
|
|
|
<if test="param.deliveryType != null and param.deliveryType!=''"> |
|
|
|
and delivery_type = #{param.deliveryType} |
|
|
|
and ldr.delivery_type = #{param.deliveryType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.orderSource != null and param.orderSource!=''"> |
|
|
|
|
|
|
|
and order_source = #{param.orderSource} |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryPhone != null and param.deliveryPhone!=''"> |
|
|
|
<if test="param.deliveryPhone != null and param.deliveryPhone!=''"> |
|
|
|
and delivery_phone = #{param.deliveryPhone} |
|
|
|
and ldr.delivery_phone like concat('%',#{param.deliveryPhone},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.trainNumber != null and param.trainNumber!=''"> |
|
|
|
<if test="param.trainNumber != null and param.trainNumber!=''"> |
|
|
|
and train_number like concat('%',#{param.trainNumber},'%') |
|
|
|
and lddl.train_number like concat('%',#{param.trainNumber},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.deliveryDriverName != null and param.deliveryDriverName!=''"> |
|
|
|
|
|
|
|
and delivery_driver_name like concat('%',#{param.deliveryDriverName},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test="param.deliveryAddress != null and param.deliveryAddress!=''"> |
|
|
|
<if test="param.deliveryAddress != null and param.deliveryAddress!=''"> |
|
|
|
and delivery_address like concat('%',#{param.deliveryAddress},'%') |
|
|
|
and ldr.delivery_address like concat('%',#{param.deliveryAddress},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.driverSigning != null and param.driverSigning!=''"> |
|
|
|
|
|
|
|
and lds.driver_signing = #{param.driverSigning} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.signingStatus != null and param.signingStatus!=''"> |
|
|
|
|
|
|
|
and lds.signing_status = #{param.signingStatus} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
</select> |
|
|
@ -396,47 +396,45 @@ |
|
|
|
select COALESCE(COUNT(*), 0) from logpm_distribution_signfor |
|
|
|
select COALESCE(COUNT(*), 0) from logpm_distribution_signfor |
|
|
|
<where> |
|
|
|
<where> |
|
|
|
is_deleted = 0 and signing_status ='1' |
|
|
|
is_deleted = 0 and signing_status ='1' |
|
|
|
<if test="param.number != null and param.number!=''"> |
|
|
|
<if test="param.mallName != null and param.mallName!=''"> |
|
|
|
and number like concat('%',#{param.number},'%') |
|
|
|
and ldr.mall_name like concat('%',#{param.mallName},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.signingStatus != null and param.signingStatus!=''"> |
|
|
|
|
|
|
|
and signing_status = #{param.signingStatus} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.shoppingName != null and param.shoppingName!=''"> |
|
|
|
|
|
|
|
and shopping_name like concat('%',#{param.shoppingName},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
<if test="param.deliveryTime!=null and param.deliveryTime!=''"> |
|
|
|
and date_format(delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
|
and date_format(lds.delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.signingTime!=null and param.signingTime!=''"> |
|
|
|
<if test="param.signingTime!=null and param.signingTime!=''"> |
|
|
|
and date_format(signing_time,'%y%m%d%') = date_format(#{param.signingTime},'%y%m%d%') |
|
|
|
and date_format(lds.signing_time,'%y%m%d%') = date_format(#{param.signingTime},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.sjsigningTime!=null and param.sjsigningTime!=''"> |
|
|
|
<if test="param.sjsigningTime!=null and param.sjsigningTime!=''"> |
|
|
|
and date_format(sjsigning_time,'%y%m%d%') = date_format(#{param.sjsigningTime},'%y%m%d%') |
|
|
|
and date_format(lds.sjsigning_time,'%y%m%d%') = date_format(#{param.sjsigningTime},'%y%m%d%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.orderId != null and param.orderId!=''"> |
|
|
|
<if test="param.createTime_query!=null and param.createTime_query!=''"> |
|
|
|
and order_id like concat('%',#{param.orderId},'%') |
|
|
|
and date_format(lds.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.stockArticleId != null and param.stockArticleId!=''"> |
|
|
|
|
|
|
|
and ldr.stock_article_id like concat('%',#{param.stockArticleId},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.consignee != null and param.consignee!=''"> |
|
|
|
<if test="param.consignee != null and param.consignee!=''"> |
|
|
|
and consignee like concat('%',#{param.consignee},'%') |
|
|
|
and ldr.consignee like concat('%',#{param.consignee},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryType != null and param.deliveryType!=''"> |
|
|
|
<if test="param.deliveryType != null and param.deliveryType!=''"> |
|
|
|
and delivery_type = #{param.deliveryType} |
|
|
|
and ldr.delivery_type = #{param.deliveryType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.orderSource != null and param.orderSource!=''"> |
|
|
|
|
|
|
|
and order_source = #{param.orderSource} |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.deliveryPhone != null and param.deliveryPhone!=''"> |
|
|
|
<if test="param.deliveryPhone != null and param.deliveryPhone!=''"> |
|
|
|
and delivery_phone = #{param.deliveryPhone} |
|
|
|
and ldr.delivery_phone like concat('%',#{param.deliveryPhone},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="param.trainNumber != null and param.trainNumber!=''"> |
|
|
|
<if test="param.trainNumber != null and param.trainNumber!=''"> |
|
|
|
and train_number like concat('%',#{param.trainNumber},'%') |
|
|
|
and lddl.train_number like concat('%',#{param.trainNumber},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.deliveryDriverName != null and param.deliveryDriverName!=''"> |
|
|
|
|
|
|
|
and delivery_driver_name like concat('%',#{param.deliveryDriverName},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test="param.deliveryAddress != null and param.deliveryAddress!=''"> |
|
|
|
<if test="param.deliveryAddress != null and param.deliveryAddress!=''"> |
|
|
|
and delivery_address like concat('%',#{param.deliveryAddress},'%') |
|
|
|
and ldr.delivery_address like concat('%',#{param.deliveryAddress},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.driverSigning != null and param.driverSigning!=''"> |
|
|
|
|
|
|
|
and lds.driver_signing = #{param.driverSigning} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="param.signingStatus != null and param.signingStatus!=''"> |
|
|
|
|
|
|
|
and lds.signing_status = #{param.signingStatus} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
</select> |
|
|
@ -447,5 +445,34 @@ |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
order by create_time desc limit 1 |
|
|
|
order by create_time desc limit 1 |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectOneCustom" resultType="com.logpm.distribution.vo.DistributionSignforVO"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
CASE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WHEN |
|
|
|
|
|
|
|
lds.driver_signing = '2' THEN |
|
|
|
|
|
|
|
'司机签收' |
|
|
|
|
|
|
|
WHEN lds.signing_status = '2' THEN |
|
|
|
|
|
|
|
'文员签收' ELSE '待签收' |
|
|
|
|
|
|
|
END signingStatusAll, |
|
|
|
|
|
|
|
ldr.reservation_code reservationCode, |
|
|
|
|
|
|
|
ldr.mall_name mallName, |
|
|
|
|
|
|
|
ldr.consignee consignee, |
|
|
|
|
|
|
|
ldr.delivery_address deliveryAddress, |
|
|
|
|
|
|
|
ldr.delivery_phone deliveryPhone, |
|
|
|
|
|
|
|
ldr.reservation_date reservationDate, |
|
|
|
|
|
|
|
CASE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WHEN ldr.delivery_type = '1' THEN |
|
|
|
|
|
|
|
'商配' |
|
|
|
|
|
|
|
WHEN ldr.delivery_type = '2' THEN |
|
|
|
|
|
|
|
'市配' |
|
|
|
|
|
|
|
END deliveryType |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
logpm_distribution_signfor lds |
|
|
|
|
|
|
|
JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id |
|
|
|
|
|
|
|
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id |
|
|
|
|
|
|
|
where lds.is_deleted = 0 and lds.id = #{id} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |
|
|
|