@ -263,28 +263,12 @@
<!-- </if> -->
<!-- </where> -->
<!-- </select> -->
<select id= "selectDistributionSignforPage" resultType= "com.logpm.distribution.vo.DistributionSignforVO" >
<!-- -- SELECT
- - lds.id id,
- - lds.shopping_name shoppingName,
- - lds.stock_article_id stockArticleId,
- - lds.consignee consignee,
- - lds.delivery_type deliveryType,
- - lds.delivery_time deliveryTime,
- - lds.order_source orderSource,
- - lds.train_number trainNumber,
- - lds.delivery_phone deliveryPhone,
- - lds.delivery_driver_name deliveryDriverName,
- - lds.delivery_address deliveryAddress,
- - lds.sjsigning_time sjsigningTime,
- - lds.signing_time signingTime,
- - lds.delivery_sign_pictures deliverySignPictures,
- - lds.reservation_num reservationNum,
- - lds.driver_signing driverSigning,
- - (SELECT sum(ldl.package_nub) from logpm_distribution_loadscan ldl WHERE ldl.reservation_id = lds.reservation_id and ldl.scan_status !=1) loadedNumber,
- - COALESCE((SELECT sum(ldl.received_quantity) from logpm_distribution_loadscan ldl WHERE ldl.reservation_id = lds.reservation_id and lds.driver_signing ='2'), 0) receivedQuantity
- - FROM
- - logpm_distribution_signfor lds-->
SELECT
lds.id id,
lds.signee_name signeeName,
@ -1367,6 +1351,112 @@
<select id= "selectByReservationId" resultType= "com.logpm.distribution.entity.DistributionSignforEntity" >
SELECT * FROM logpm_distribution_signfor WHERE reservation_id = #{reservationId}
</select>
<select id= "selectDistributionSignforPageCount" resultType= "com.logpm.distribution.vo.SignforPageCountVO" >
SELECT
sum(lds.received_quantity+receivedin_quantity) signeeNumber,
sum(ldr.reservation_num + ldr.reservation_stock_list_num) totalNumber,
sum(lds.loaded_number+lds.loadedin_number) loadedNumber
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 ldr.is_deleted = 0 and lddl.is_deleted = 0 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0 AND lddl.customers_number > 0
<if test= "param.mallName != null and param.mallName!=''" >
and ldr.mall_name like concat('%',#{param.mallName},'%')
</if>
<if test= "param.ids != null" > and lds.id in
<foreach collection= "param.ids" separator= "," close= ")" open= "(" item= "a" >
#{a}
</foreach>
</if>
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and ldr.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.storeName != null and param.storeName!=''" >
and ldr.store_name like concat('%',#{param.storeName},'%')
</if>
<if test= "param.reservationCode != null and param.reservationCode!=''" >
and ldr.reservation_code like concat('%',#{param.reservationCode},'%')
</if>
<if test= "param.driverName != null and param.driverName!=''" >
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test= "param.vehicleName != null and param.vehicleName!=''" >
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test= "param.deliveryTime!=null and param.deliveryTime!=''" >
and date_format(lds.delivery_time,'%y%m%d%') = date_format(#{param.deliveryTime},'%y%m%d%')
</if>
<if test= "param.signingTime!=null and param.signingTime!=''" >
and date_format(lds.signing_time,'%y%m%d%') = date_format(#{param.signingTime},'%y%m%d%')
</if>
<if test= "param.sjsigningTime!=null and param.sjsigningTime!=''" >
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 test= "param.stockArticleId != null and param.stockArticleId!=''" >
and ldr.stock_article_id like concat('%',#{param.stockArticleId},'%')
</if>
<if test= "param.consignee != null and param.consignee!=''" >
and ldr.consignee like concat('%',#{param.consignee},'%')
</if>
<if test= "param.deliveryType != null and param.deliveryType!=''" >
and ldr.delivery_type = #{param.deliveryType}
</if>
<if test= "param.deliveryPhone != null and param.deliveryPhone!=''" >
and ldr.delivery_phone like concat('%',#{param.deliveryPhone},'%')
</if>
<if test= "param.trainNumber != null and param.trainNumber!=''" >
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test= "param.deliveryAddress != null and 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 test= "param.taskTime != null and param.taskTime!=''" >
and date_format(lddl.task_time,'%Y-%m-%d') = #{param.taskTime}
</if>
<if test= "param.signLoadingDate != null and param.signLoadingDate!=''" >
and date_format(lddl.loading_time,'%Y-%m-%d') = #{param.signLoadingDate}
</if>
<if test= "param.taskTimeSection != null and param.taskTimeSection!=''" >
and lddl.task_time between #{param.taskTimeSection[0]} and #{param.taskTimeSection[1]}
</if>
<if test= "param.loadingTimeSection != null and param.loadingTimeSection!=''" >
and lddl.loading_time between #{param.loadingTimeSection[0]} and #{param.loadingTimeSection[1]}
</if>
<if test= "param.signeeName != null and param.signeeName!=''" >
and lds.signee_name like concat('%',#{param.signeeName},'%')
</if>
<if test= "param.sjsigningTimeSection != null and param.sjsigningTimeSection!=''" >
and lds.sjsigning_time between #{param.sjsigningTimeSection[0]} and #{param.sjsigningTimeSection[1]}
</if>
<if test= "param.signingTimeSection != null and param.signingTimeSection!=''" >
and lds.signing_time between #{param.signingTimeSection[0]} and #{param.signingTimeSection[1]}
</if>
<if test= "param.clientIds != null" >
and ldr.mall_id in
<foreach collection= "param.clientIds" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
</where>
</select>
<select id= "getByReservationIds" resultType= "java.util.Map" >
SELECT
ldr.reservation_code AS reservationCode,