|
@@ -88,16 +88,17 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
" left join company_tcm_schedule cts on cts.id = o.schedule_id " +
|
|
" left join company_tcm_schedule cts on cts.id = o.schedule_id " +
|
|
|
" left join fs_store_product_scrm psps on i.product_id=psps.product_id " +
|
|
" left join fs_store_product_scrm psps on i.product_id=psps.product_id " +
|
|
|
" left join fs_store_product_category_scrm fspcs on fspcs.cate_id=psps.cate_id " +
|
|
" left join fs_store_product_category_scrm fspcs on fspcs.cate_id=psps.cate_id " +
|
|
|
- " LEFT JOIN (\n" +
|
|
|
|
|
- " SELECT\n" +
|
|
|
|
|
- " sp.*,\n" +
|
|
|
|
|
- " ROW_NUMBER() OVER (PARTITION BY sp.business_code ORDER BY sp.create_time DESC) as rn\n" +
|
|
|
|
|
- " FROM fs_store_payment_scrm sp\n" +
|
|
|
|
|
- " WHERE sp.business_code IS NOT NULL\n" +
|
|
|
|
|
- " ) sp_latest ON sp_latest.business_code = o.order_code AND sp_latest.rn = 1\n" +
|
|
|
|
|
|
|
+ " LEFT JOIN (" +
|
|
|
|
|
+ " SELECT sp.*, ROW_NUMBER() OVER (PARTITION BY sp.business_code ORDER BY sp.create_time DESC) as rn" +
|
|
|
|
|
+ " FROM fs_store_payment_scrm sp WHERE sp.business_code IS NOT NULL" +
|
|
|
|
|
+ " ) sp_latest ON sp_latest.order_id = o.id AND sp_latest.rn = 1" +
|
|
|
|
|
+ " LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id" +
|
|
|
|
|
+ " <if test=\"maps.erpAccount != null and maps.erpAccount != ''\">" +
|
|
|
|
|
+ " LEFT JOIN fs_store_order_df df on df.order_id=o.id " +
|
|
|
|
|
+ " </if>" +
|
|
|
" where 1=1 " +
|
|
" where 1=1 " +
|
|
|
- "<if test=\"maps.bankTransactionId !=null and maps.bankTransactionId!=''\">" +
|
|
|
|
|
- " and sp_latest.bank_transaction_id = #{maps.bankTransactionId} " +
|
|
|
|
|
|
|
+ "<if test=\"maps.appId != null and maps.appId != ''\">" +
|
|
|
|
|
+ " and csc.appid = #{maps.appId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test=\"maps.orderCodes != null and maps.orderCodes.size > 0\">" +
|
|
"<if test=\"maps.orderCodes != null and maps.orderCodes.size > 0\">" +
|
|
|
" and o.order_code in" +
|
|
" and o.order_code in" +
|
|
@@ -108,12 +109,24 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
"<if test = 'maps.orderCode != null and maps.orderCode !=\"\" '> " +
|
|
"<if test = 'maps.orderCode != null and maps.orderCode !=\"\" '> " +
|
|
|
"and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
|
|
"and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.deliveryId != null '> " +
|
|
|
|
|
- "and o.delivery_id =#{maps.deliveryId} " +
|
|
|
|
|
|
|
+ "<if test=\"maps.bankTransactionId != null and maps.bankTransactionId !=''\">" +
|
|
|
|
|
+ " and sp_latest.bank_transaction_id like CONCAT('%',#{maps.bankTransactionId},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.isPayRemain != null\">" +
|
|
|
|
|
+ " and o.is_pay_remain =#{maps.isPayRemain} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.userId != null\">" +
|
|
|
|
|
+ " and o.user_id =#{maps.userId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryId != null and maps.deliveryId !=''\">" +
|
|
|
|
|
+ " and o.delivery_id =#{maps.deliveryId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.nickname != null and maps.nickname !=\"\" '> " +
|
|
"<if test = 'maps.nickname != null and maps.nickname !=\"\" '> " +
|
|
|
"and u.nickname like CONCAT('%',#{maps.nickname},'%') " +
|
|
"and u.nickname like CONCAT('%',#{maps.nickname},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test=\"maps.realName != null and maps.realName !=''\">" +
|
|
|
|
|
+ " and o.real_name like CONCAT('%',#{maps.realName},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.phone != null and maps.phone !=\"\" '> " +
|
|
"<if test = 'maps.phone != null and maps.phone !=\"\" '> " +
|
|
|
"and u.phone like CONCAT('%',#{maps.phone},'%') " +
|
|
"and u.phone like CONCAT('%',#{maps.phone},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
@@ -126,19 +139,26 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
"<if test = 'maps.status != null and maps.status == 6 '> " +
|
|
"<if test = 'maps.status != null and maps.status == 6 '> " +
|
|
|
"and o.`status`= 1 and (o.extend_order_id is null or o.extend_order_id like '') " +
|
|
"and o.`status`= 1 and (o.extend_order_id is null or o.extend_order_id like '') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test = 'maps.isUpload != null and maps.isUpload == 0 '> " +
|
|
|
|
|
+ "and o.certificates is null " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.isUpload != null and maps.isUpload == 1 '> " +
|
|
|
|
|
+ "and o.certificates is not null " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryStatus != null \">" +
|
|
|
|
|
+ " and o.delivery_status =#{maps.deliveryStatus}" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryPayStatus != null \">" +
|
|
|
|
|
+ " and o.delivery_pay_status =#{maps.deliveryPayStatus}" +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.companyId != null '> " +
|
|
"<if test = 'maps.companyId != null '> " +
|
|
|
"and o.company_id =#{maps.companyId} " +
|
|
"and o.company_id =#{maps.companyId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- " <if test=\"maps.realName != null and maps.realName !=''\">\n" +
|
|
|
|
|
- " and o.real_name like CONCAT('%',#{maps.realName},'%')\n" +
|
|
|
|
|
- " </if>"+
|
|
|
|
|
"<if test = 'maps.isHealth != null and maps.isHealth != \"\" '> " +
|
|
"<if test = 'maps.isHealth != null and maps.isHealth != \"\" '> " +
|
|
|
-// "and (o.company_id is null or o.order_type = 2 ) " +
|
|
|
|
|
- " and (o.company_id is null\n" +
|
|
|
|
|
- " or o.order_type = 2 or o.order_type = 3)"+
|
|
|
|
|
|
|
+ " and (o.company_id is null or o.order_type = 2 or o.order_type = 3)" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.notHealth != null and maps.notHealth != \"\" '> " +
|
|
|
|
|
- "and o.company_id is not null " +
|
|
|
|
|
|
|
+ "<if test = 'maps.notHealth != null '> " +
|
|
|
|
|
+ "and o.company_id is not null and o.order_type = 0 " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.companyUserId != null '> " +
|
|
"<if test = 'maps.companyUserId != null '> " +
|
|
|
"and o.company_user_id =#{maps.companyUserId} " +
|
|
"and o.company_user_id =#{maps.companyUserId} " +
|
|
@@ -146,52 +166,70 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName != \"\" '> " +
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName != \"\" '> " +
|
|
|
"and cu.nick_name like concat('%', #{maps.companyUserNickName}, '%') " +
|
|
"and cu.nick_name like concat('%', #{maps.companyUserNickName}, '%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test=\"maps.payCode != null and maps.payCode != ''\">" +
|
|
|
|
|
+ " and sp_latest.pay_code like CONCAT('%', #{maps.payCode}, '%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.productName != null and maps.productName != '' \">" +
|
|
|
|
|
+ " and psps.product_name like concat('%', #{maps.productName}, '%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.orderType != null and maps.orderType != -1 '> " +
|
|
"<if test = 'maps.orderType != null and maps.orderType != -1 '> " +
|
|
|
"and o.order_type =#{maps.orderType} " +
|
|
"and o.order_type =#{maps.orderType} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.orderType != null and maps.orderType == -1 '> " +
|
|
"<if test = 'maps.orderType != null and maps.orderType == -1 '> " +
|
|
|
"and o.order_type in (2, 3) " +
|
|
"and o.order_type in (2, 3) " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test = 'maps.payType != null '> " +
|
|
|
|
|
+ "and o.pay_type =#{maps.payType} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.scheduleId != null '> " +
|
|
|
|
|
+ "and o.schedule_id =#{maps.scheduleId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.createTimeList != null '> " +
|
|
"<if test = 'maps.createTimeList != null '> " +
|
|
|
" AND date_format(o.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.payTimeList != null '> " +
|
|
|
|
|
- " AND date_format(o.pay_time,'%y%m%d') >= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
|
|
|
|
|
- " AND date_format(o.pay_time,'%y%m%d') <= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
"<if test = 'maps.deliverySendTimeList != null '> " +
|
|
"<if test = 'maps.deliverySendTimeList != null '> " +
|
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') >= date_format(#{maps.deliverySendTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') >= date_format(#{maps.deliverySendTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') <= date_format(#{maps.deliverySendTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') <= date_format(#{maps.deliverySendTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test = 'maps.paidStatus != null '> " +
|
|
|
|
|
+ "and o.paid =#{maps.paidStatus} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.payTimeList != null '> " +
|
|
|
|
|
+ " AND date_format(o.pay_time,'%y%m%d') >= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
|
|
|
|
|
+ " AND date_format(o.pay_time,'%y%m%d') <= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.deliveryImportTimeList != null '> " +
|
|
"<if test = 'maps.deliveryImportTimeList != null '> " +
|
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') >= date_format(#{maps.deliveryImportTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') >= date_format(#{maps.deliveryImportTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.isUpload != null and maps.isUpload == 0 '> " +
|
|
|
|
|
- "and o.certificates is null " +
|
|
|
|
|
|
|
+ "<if test=\"maps.deptId != null\">" +
|
|
|
|
|
+ " AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (" +
|
|
|
|
|
+ " SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)" +
|
|
|
|
|
+ " ))" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.isUpload != null and maps.isUpload == 1 '> " +
|
|
|
|
|
- "and o.certificates is not null " +
|
|
|
|
|
|
|
+ "<if test=\"maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''\">" +
|
|
|
|
|
+ " and o.erp_phone like concat(#{maps.erpPhoneNumber},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.scheduleId != null '> " +
|
|
|
|
|
- "and o.schedule_id =#{maps.scheduleId} " +
|
|
|
|
|
|
|
+ "<if test=\"maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''\">" +
|
|
|
|
|
+ " and df.login_account like #{maps.erpAccount} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.erpAccount == '未分拣'\">" +
|
|
|
|
|
+ " and ( df.login_account is null or df.login_account like '') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- " <if test=\"maps.deliveryPayStatus != null \">\n" +
|
|
|
|
|
- " and o.delivery_pay_status =#{maps.deliveryPayStatus}\n" +
|
|
|
|
|
- " </if>"+
|
|
|
|
|
- " <if test=\"maps.deliveryStatus != null \">\n" +
|
|
|
|
|
- " and o.delivery_status =#{maps.deliveryStatus}\n" +
|
|
|
|
|
- " </if>"+
|
|
|
|
|
- " <if test=\"maps.productName != null and maps.productName != '' \">\n" +
|
|
|
|
|
- " and psps.product_name like concat('%', #{maps.productName}, '%')\n" +
|
|
|
|
|
- " </if>"+
|
|
|
|
|
"<if test = 'maps.isAudit != null'> " +
|
|
"<if test = 'maps.isAudit != null'> " +
|
|
|
- "and o.is_audit = #{maps.isAudit} \n" +
|
|
|
|
|
|
|
+ "and o.is_audit = #{maps.isAudit} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.isCompanyOrder != null and maps.isCompanyOrder > 0\">" +
|
|
|
|
|
+ " and o.order_type != 3 and o.order_type != 2" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- " <if test=\"maps.isCompanyOrder != null and maps.isCompanyOrder > 0\">\n" +
|
|
|
|
|
- " and o.order_type != 3 and o.order_type != 2\n" +
|
|
|
|
|
- " </if>"+
|
|
|
|
|
|
|
+ "<if test=\"maps.companyUserIds != null and maps.companyUserIds.size > 0\">" +
|
|
|
|
|
+ " and o.company_user_id in" +
|
|
|
|
|
+ " <foreach collection=\"maps.companyUserIds\" item=\"companyUserId\" open=\"(\" close=\")\" separator=\",\">" +
|
|
|
|
|
+ " #{companyUserId}" +
|
|
|
|
|
+ " </foreach>" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ " ${maps.params.dataScope} " +
|
|
|
"GROUP BY o.id order by o.id desc limit 50000"+
|
|
"GROUP BY o.id order by o.id desc limit 50000"+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<FsStoreOrderItemExportVO> selectFsStoreOrderItemListExportVO(@Param("maps")FsStoreOrderParam fsStoreOrder);
|
|
List<FsStoreOrderItemExportVO> selectFsStoreOrderItemListExportVO(@Param("maps")FsStoreOrderParam fsStoreOrder);
|
|
@@ -204,67 +242,78 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
"left join company c on c.company_id=o.company_id " +
|
|
"left join company c on c.company_id=o.company_id " +
|
|
|
"left join company_user cu on cu.user_id=o.company_user_id " +
|
|
"left join company_user cu on cu.user_id=o.company_user_id " +
|
|
|
"left join company_tcm_schedule cts on cts.id = o.schedule_id " +
|
|
"left join company_tcm_schedule cts on cts.id = o.schedule_id " +
|
|
|
- "LEFT JOIN fs_store_order_df df on df.order_id=o.id\n" +
|
|
|
|
|
- " <if test=\"maps.bankTransactionId !=null and maps.bankTransactionId!=''\">\n" +
|
|
|
|
|
- " LEFT JOIN (\n" +
|
|
|
|
|
- " SELECT\n" +
|
|
|
|
|
- " sp.*,\n" +
|
|
|
|
|
- " ROW_NUMBER() OVER (PARTITION BY sp.business_code ORDER BY sp.create_time DESC) as rn\n" +
|
|
|
|
|
- " FROM fs_store_payment_scrm sp\n" +
|
|
|
|
|
- " WHERE sp.business_code IS NOT NULL\n" +
|
|
|
|
|
- " ) sp_latest ON sp_latest.business_code = o.order_code AND sp_latest.rn = 1\n" +
|
|
|
|
|
- "<if test=\"maps.appId != null and maps.appId != ''\">" +
|
|
|
|
|
- " LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id\n" +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
- " </if>" +
|
|
|
|
|
|
|
+ " left join fs_store_product_scrm psps on i.product_id=psps.product_id " +
|
|
|
|
|
+ " LEFT JOIN (" +
|
|
|
|
|
+ " SELECT sp.*, ROW_NUMBER() OVER (PARTITION BY sp.business_code ORDER BY sp.create_time DESC) as rn" +
|
|
|
|
|
+ " FROM fs_store_payment_scrm sp WHERE sp.business_code IS NOT NULL" +
|
|
|
|
|
+ " ) sp_latest ON sp_latest.order_id = o.id AND sp_latest.rn = 1" +
|
|
|
|
|
+ " LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id" +
|
|
|
|
|
+ " <if test=\"maps.erpAccount != null and maps.erpAccount != ''\">" +
|
|
|
|
|
+ " LEFT JOIN fs_store_order_df df on df.order_id=o.id " +
|
|
|
|
|
+ " </if>" +
|
|
|
"where 1=1 " +
|
|
"where 1=1 " +
|
|
|
- "<if test=\"maps.bankTransactionId !=null and maps.bankTransactionId!=''\">" +
|
|
|
|
|
- "and sp_latest.bank_transaction_id = #{maps.bankTransactionId}\n" +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
- "<if test=\"maps.appId != null and maps.appId != ''\">\n" +
|
|
|
|
|
- " and csc.appid = #{maps.appId}\n" +
|
|
|
|
|
- " </if>\n" +
|
|
|
|
|
- " <if test=\"maps.orderCodes != null and maps.orderCodes.size > 0\">\n" +
|
|
|
|
|
- " and o.order_code in\n" +
|
|
|
|
|
- " <foreach collection=\"maps.orderCodes\" item=\"orderCode\" open=\"(\" close=\")\" separator=\",\">\n" +
|
|
|
|
|
- " #{orderCode}\n" +
|
|
|
|
|
- " </foreach>\n" +
|
|
|
|
|
- " </if>" +
|
|
|
|
|
|
|
+ "<if test=\"maps.appId != null and maps.appId != ''\">" +
|
|
|
|
|
+ " and csc.appid = #{maps.appId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.orderCodes != null and maps.orderCodes.size > 0\">" +
|
|
|
|
|
+ " and o.order_code in" +
|
|
|
|
|
+ " <foreach collection=\"maps.orderCodes\" item=\"orderCode\" open=\"(\" close=\")\" separator=\",\">" +
|
|
|
|
|
+ " #{orderCode}" +
|
|
|
|
|
+ " </foreach>" +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.orderCode != null and maps.orderCode !=\"\" '> " +
|
|
"<if test = 'maps.orderCode != null and maps.orderCode !=\"\" '> " +
|
|
|
"and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
|
|
"and o.order_code like CONCAT('%',#{maps.orderCode},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.deliveryId != null '> " +
|
|
|
|
|
- "and o.delivery_id =#{maps.deliveryId} " +
|
|
|
|
|
|
|
+ "<if test=\"maps.bankTransactionId != null and maps.bankTransactionId !=''\">" +
|
|
|
|
|
+ " and sp_latest.bank_transaction_id like CONCAT('%',#{maps.bankTransactionId},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.isPayRemain != null\">" +
|
|
|
|
|
+ " and o.is_pay_remain =#{maps.isPayRemain} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.userId != null\">" +
|
|
|
|
|
+ " and o.user_id =#{maps.userId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryId != null and maps.deliveryId !=''\">" +
|
|
|
|
|
+ " and o.delivery_id =#{maps.deliveryId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.nickname != null and maps.nickname !=\"\" '> " +
|
|
"<if test = 'maps.nickname != null and maps.nickname !=\"\" '> " +
|
|
|
"and u.nickname like CONCAT('%',#{maps.nickname},'%') " +
|
|
"and u.nickname like CONCAT('%',#{maps.nickname},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test=\"maps.realName != null and maps.realName !=''\">" +
|
|
|
|
|
+ " and o.real_name like CONCAT('%',#{maps.realName},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.phone != null and maps.phone !=\"\" '> " +
|
|
"<if test = 'maps.phone != null and maps.phone !=\"\" '> " +
|
|
|
"and u.phone like CONCAT('%',#{maps.phone},'%') " +
|
|
"and u.phone like CONCAT('%',#{maps.phone},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.realName != null and maps.realName !=\"\" '> " +
|
|
|
|
|
- "and o.real_name like CONCAT('%',#{maps.realName},'%') " +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
"<if test = 'maps.userPhone != null and maps.userPhone !=\"\" '> " +
|
|
"<if test = 'maps.userPhone != null and maps.userPhone !=\"\" '> " +
|
|
|
"and o.user_phone like CONCAT('%',#{maps.userPhone},'%') " +
|
|
"and o.user_phone like CONCAT('%',#{maps.userPhone},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test=\"maps.status != null and maps.status != 6\">\n" +
|
|
|
|
|
- " and o.status = #{maps.status}\n" +
|
|
|
|
|
- " </if>\n" +
|
|
|
|
|
- " <if test=\"maps.status == 6\">\n" +
|
|
|
|
|
- " and o.`status`= 1\n" +
|
|
|
|
|
- "\n" +
|
|
|
|
|
- " and (o.extend_order_id is null or o.extend_order_id like '')\n" +
|
|
|
|
|
- " </if>" +
|
|
|
|
|
-
|
|
|
|
|
|
|
+ "<if test = 'maps.status != null and maps.status != 6 '> " +
|
|
|
|
|
+ "and o.status =#{maps.status} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.status != null and maps.status == 6 '> " +
|
|
|
|
|
+ "and o.`status`= 1 and (o.extend_order_id is null or o.extend_order_id like '') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.isUpload != null and maps.isUpload == 0 '> " +
|
|
|
|
|
+ "and o.certificates is null " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.isUpload != null and maps.isUpload == 1 '> " +
|
|
|
|
|
+ "and o.certificates is not null " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryStatus != null \">" +
|
|
|
|
|
+ " and o.delivery_status =#{maps.deliveryStatus}" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.deliveryPayStatus != null \">" +
|
|
|
|
|
+ " and o.delivery_pay_status =#{maps.deliveryPayStatus}" +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.companyId != null '> " +
|
|
"<if test = 'maps.companyId != null '> " +
|
|
|
"and o.company_id =#{maps.companyId} " +
|
|
"and o.company_id =#{maps.companyId} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.isHealth != null and maps.isHealth != \"\" '> " +
|
|
"<if test = 'maps.isHealth != null and maps.isHealth != \"\" '> " +
|
|
|
- "and o.company_id is null " +
|
|
|
|
|
|
|
+ " and (o.company_id is null or o.order_type = 2 or o.order_type = 3)" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.notHealth != null and maps.notHealth != \"\" '> " +
|
|
|
|
|
- "and o.company_id is not null " +
|
|
|
|
|
|
|
+ "<if test = 'maps.notHealth != null '> " +
|
|
|
|
|
+ "and o.company_id is not null and o.order_type = 0 " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.companyUserId != null '> " +
|
|
"<if test = 'maps.companyUserId != null '> " +
|
|
|
"and o.company_user_id =#{maps.companyUserId} " +
|
|
"and o.company_user_id =#{maps.companyUserId} " +
|
|
@@ -272,47 +321,70 @@ public interface FsStoreOrderItemScrmMapper
|
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName != \"\" '> " +
|
|
"<if test = 'maps.companyUserNickName != null and maps.companyUserNickName != \"\" '> " +
|
|
|
"and cu.nick_name like concat('%', #{maps.companyUserNickName}, '%') " +
|
|
"and cu.nick_name like concat('%', #{maps.companyUserNickName}, '%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test=\"maps.payCode != null and maps.payCode != ''\">" +
|
|
|
|
|
+ " and sp_latest.pay_code like CONCAT('%', #{maps.payCode}, '%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.productName != null and maps.productName != '' \">" +
|
|
|
|
|
+ " and psps.product_name like concat('%', #{maps.productName}, '%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.orderType != null and maps.orderType != -1 '> " +
|
|
"<if test = 'maps.orderType != null and maps.orderType != -1 '> " +
|
|
|
"and o.order_type =#{maps.orderType} " +
|
|
"and o.order_type =#{maps.orderType} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.orderType != null and maps.orderType == -1 '> " +
|
|
"<if test = 'maps.orderType != null and maps.orderType == -1 '> " +
|
|
|
"and o.order_type in (2, 3) " +
|
|
"and o.order_type in (2, 3) " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test = 'maps.payType != null '> " +
|
|
|
|
|
+ "and o.pay_type =#{maps.payType} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.scheduleId != null '> " +
|
|
|
|
|
+ "and o.schedule_id =#{maps.scheduleId} " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.createTimeList != null '> " +
|
|
"<if test = 'maps.createTimeList != null '> " +
|
|
|
" AND date_format(o.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.payTimeList != null '> " +
|
|
|
|
|
- " AND date_format(o.pay_time,'%y%m%d') >= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
|
|
|
|
|
- " AND date_format(o.pay_time,'%y%m%d') <= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
"<if test = 'maps.deliverySendTimeList != null '> " +
|
|
"<if test = 'maps.deliverySendTimeList != null '> " +
|
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') >= date_format(#{maps.deliverySendTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') >= date_format(#{maps.deliverySendTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') <= date_format(#{maps.deliverySendTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_send_time,'%y%m%d') <= date_format(#{maps.deliverySendTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
|
|
+ "<if test = 'maps.paidStatus != null '> " +
|
|
|
|
|
+ "and o.paid =#{maps.paidStatus} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.payTimeList != null '> " +
|
|
|
|
|
+ " AND date_format(o.pay_time,'%y%m%d') >= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
|
|
|
|
|
+ " AND date_format(o.pay_time,'%y%m%d') <= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
|
|
|
|
|
+ "</if>" +
|
|
|
"<if test = 'maps.deliveryImportTimeList != null '> " +
|
|
"<if test = 'maps.deliveryImportTimeList != null '> " +
|
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') >= date_format(#{maps.deliveryImportTimeList[0]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') >= date_format(#{maps.deliveryImportTimeList[0]},'%y%m%d') " +
|
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d') " +
|
|
" AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.isUpload != null and maps.isUpload == 0 '> " +
|
|
|
|
|
- "and o.certificates is null " +
|
|
|
|
|
|
|
+ "<if test=\"maps.deptId != null\">" +
|
|
|
|
|
+ " AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (" +
|
|
|
|
|
+ " SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)" +
|
|
|
|
|
+ " ))" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.isUpload != null and maps.isUpload == 1 '> " +
|
|
|
|
|
- "and o.certificates is not null " +
|
|
|
|
|
|
|
+ "<if test=\"maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''\">" +
|
|
|
|
|
+ " and o.erp_phone like concat(#{maps.erpPhoneNumber},'%') " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.scheduleId != null '> " +
|
|
|
|
|
- "and o.schedule_id =#{maps.scheduleId} " +
|
|
|
|
|
|
|
+ "<if test=\"maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''\">" +
|
|
|
|
|
+ " and df.login_account like #{maps.erpAccount} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.erpAccount == '未分拣'\">" +
|
|
|
|
|
+ " and ( df.login_account is null or df.login_account like '') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.isAudit != null'> " +
|
|
|
|
|
+ "and o.is_audit = #{maps.isAudit} " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.isCompanyOrder != null and maps.isCompanyOrder > 0\">" +
|
|
|
|
|
+ " and o.order_type != 3 and o.order_type != 2" +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test=\"maps.companyUserIds != null and maps.companyUserIds.size > 0\">" +
|
|
|
|
|
+ " and o.company_user_id in" +
|
|
|
|
|
+ " <foreach collection=\"maps.companyUserIds\" item=\"companyUserId\" open=\"(\" close=\")\" separator=\",\">" +
|
|
|
|
|
+ " #{companyUserId}" +
|
|
|
|
|
+ " </foreach>" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test=\"maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''\">\n" +
|
|
|
|
|
- " and o.erp_phone like concat(#{maps.erpPhoneNumber},'%')\n" +
|
|
|
|
|
- " </if>\n" +
|
|
|
|
|
- " <if test=\"maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''\">\n" +
|
|
|
|
|
- " and df.login_account like #{maps.erpAccount}\n" +
|
|
|
|
|
- " </if>\n" +
|
|
|
|
|
- " <if test=\"maps.erpAccount == '未分拣'\">\n" +
|
|
|
|
|
- " and ( df.login_account is null or df.login_account like '')\n" +
|
|
|
|
|
- " </if>" +
|
|
|
|
|
- " order by o.id desc "+
|
|
|
|
|
|
|
+ " ${maps.params.dataScope} " +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
Long itemsCount(@Param("maps")FsStoreOrderParam fsStoreOrder);
|
|
Long itemsCount(@Param("maps")FsStoreOrderParam fsStoreOrder);
|
|
|
|
|
|