Commit 34099b02 authored by liuzeheng's avatar liuzeheng

订单状态

parent 2e8bac5c
...@@ -4304,70 +4304,230 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -4304,70 +4304,230 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"<when test = 'query.packageType != null and query.packageType != \"\" '>", "<when test = 'query.packageType != null and query.packageType != \"\" '>",
"AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')", "AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')",
"</when>", "</when>",
"<when test = 'query.isExternalWarehouse != null'>", "<if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse.size()>0\">\n" +
"AND o.`is_external_warehouse` = #{query.isExternalWarehouse}", "\n" +
"</when>", " <if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse != '' and query.isExternalWarehouse.size()==1 \">\n" +
"<when test = 'query.status != null'>", " AND o.`is_external_warehouse` =\n" +
"AND o.`status` = #{query.status}", " <foreach item='isExternalWarehouse' index=\"index\" collection='query.isExternalWarehouse' >\n" +
"</when>", " #{isExternalWarehouse}\n" +
"<when test = 'query.abnormalState != null'>", " </foreach>\n" +
"<choose>", " </if>\n" +
"<when test = 'query.abnormalState != 0'>", "\n" +
"<choose>", " <if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse != '' and query.isExternalWarehouse.size()>1 \">\n" +
"<when test = 'query.abnormalState != -1'>", " AND o.`is_external_warehouse` in\n" +
"AND o.`abnormal_state` = #{query.abnormalState}", " <foreach item='isExternalWarehouse' index=\"index\" collection='query.isExternalWarehouse' open='(' separator=',' close=')'>\n" +
"</when>", " #{isExternalWarehouse}\n" +
"<otherwise>", " </foreach>\n" +
"AND o.`abnormal_state` != 0", " </if>\n" +
"</otherwise>", "\n" +
"</choose>", " </if>",
"</when>", // "<when test = 'query.isExternalWarehouse != null'>",
"<otherwise>", // "AND o.`is_external_warehouse` = #{query.isExternalWarehouse}",
"AND o.`abnormal_state` = 0", // "</when>",
"</otherwise>", " <if test=\"query.statusList != null and query.statusList.size()>0\">\n" +
"</choose>", "\n" +
"</when>", " <if test=\"query.statusList != null and query.statusList != '' and query.statusList.size()==1 \">\n" +
" AND o.`status` =\n" +
" <foreach item='status' index=\"index\" collection='query.statusList' >\n" +
" #{status}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.statusList != null and query.statusList != '' and query.statusList.size()>1 \">\n" +
" AND o.`status` in\n" +
" <foreach item='status' index=\"index\" collection='query.statusList' open='(' separator=',' close=')'>\n" +
" #{status}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
// "<when test = 'query.status != null'>",
// "AND o.`status` = #{query.status}",
// "</when>",
" <if test=\"query.abnormalState != null and query.abnormalState.size()>0\">\n" +
"\n" +
" <if test=\"query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()==1 \">\n" +
"\n" +
" <foreach item='abnormalState' index=\"index\" collection='query.abnormalState' >\n" +
"\n" +
" <choose>\n" +
" <when test=\"abnormalState != '0'\">\n" +
" <choose>\n" +
" <when test=\"abnormalState != '-1'\">\n" +
" AND o.`abnormal_state` = #{abnormalState}\n" +
" </when>\n" +
" <otherwise>\n" +
" AND o.`abnormal_state` != 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </when>\n" +
" <otherwise>\n" +
" AND o.`abnormal_state` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()>1 \">\n" +
" AND (1!=1\n" +
" <foreach item='abnormalState' index=\"index\" collection='query.abnormalState'>\n" +
"\n" +
" <choose>\n" +
" <when test=\"abnormalState != '0'\">\n" +
" <choose>\n" +
" <when test=\"abnormalState != '-1'\">\n" +
" OR o.`abnormal_state` = #{abnormalState}\n" +
" </when>\n" +
" <otherwise>\n" +
" OR o.`abnormal_state` != 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </when>\n" +
" <otherwise>\n" +
" OR o.`abnormal_state` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
"\n" +
" )\n" +
" </if>\n" +
"\n" +
" </if>",
// "<when test = 'query.abnormalState != null'>",
// "<choose>",
// "<when test = 'query.abnormalState != 0'>",
// "<choose>",
// "<when test = 'query.abnormalState != -1'>",
// "AND o.`abnormal_state` = #{query.abnormalState}",
// "</when>",
// "<otherwise>",
// "AND o.`abnormal_state` != 0",
// "</otherwise>",
// "</choose>",
// "</when>",
// "<otherwise>",
// "AND o.`abnormal_state` = 0",
// "</otherwise>",
// "</choose>",
// "</when>",
"<when test = 'query.inWarehouseState != null'>", "<when test = 'query.inWarehouseState != null'>",
"AND o.`in_warehouse_state` = #{query.inWarehouseState}", "AND o.`in_warehouse_state` = #{query.inWarehouseState}",
"</when>", "</when>",
"<when test = 'query.shipmentState != null'>", "<when test = 'query.shipmentState != null'>",
"AND o.`shipment_State` = #{query.shipmentState}", "AND o.`shipment_State` = #{query.shipmentState}",
"</when>", "</when>",
"<when test = 'query.auditType != null'>", " <if test=\"query.auditType != null and query.auditType.size()>0\">\n" +
"<choose>", "\n" +
"<when test = 'query.auditType != 0'>", " <if test=\"query.auditType != null and query.auditType != '' and query.auditType.size()==1 \">\n" +
"<choose>", "\n" +
"<when test = 'query.auditType != -1'>", " <foreach item='auditType' index=\"index\" collection='query.auditType' >\n" +
"AND o.`audit_type` = #{query.auditType}", "\n" +
"</when>", " <choose>\n" +
"<otherwise>", " <when test=\"auditType != 0\">\n" +
"AND o.`audit_type` != 0", " <choose>\n" +
"</otherwise>", " <when test=\"auditType != -1\">\n" +
"</choose>", " AND o.`audit_type` = #{auditType}\n" +
"</when>", " </when>\n" +
"<otherwise>", " <otherwise>\n" +
"AND o.`audit_type` = 0", " AND o.`audit_type` != 0\n" +
"</otherwise>", " </otherwise>\n" +
"</choose>", " </choose>\n" +
"</when>", " </when>\n" +
" <otherwise>\n" +
" AND o.`audit_type` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
" </if>\n" +
" </if>",
// "<when test = 'query.auditType != null'>",
// "<choose>",
// "<when test = 'query.auditType != 0'>",
// "<choose>",
// "<when test = 'query.auditType != -1'>",
// "AND o.`audit_type` = #{query.auditType}",
// "</when>",
// "<otherwise>",
// "AND o.`audit_type` != 0",
// "</otherwise>",
// "</choose>",
// "</when>",
// "<otherwise>",
// "AND o.`audit_type` = 0",
// "</otherwise>",
// "</choose>",
// "</when>",
"<when test = 'query.salesmanId != null '>", "<when test = 'query.salesmanId != null '>",
"AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))", "AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))",
"</when>", "</when>",
"<when test = 'query.customsType != null'>", // "<when test = 'query.customsType != null'>",
"AND o.`customs_type` = #{query.customsType}", // "AND o.`customs_type` = #{query.customsType}",
"</when>", // "</when>",
"<when test = 'query.productRecord != null'>", // "<when test = 'query.productRecord != null'>",
"AND o.`product_record` = #{query.productRecord}", // "AND o.`product_record` = #{query.productRecord}",
"</when>", // "</when>",
" <if test=\"query.customsType != null and query.customsType.size()>0\">\n" +
"\n" +
" <if test=\"query.customsType != null and query.customsType != '' and query.customsType.size()==1 \">\n" +
" AND o.`customs_type` =\n" +
" <foreach item='customsType' index=\"index\" collection='query.customsType' >\n" +
" #{customsType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.customsType != null and query.customsType != '' and query.customsType.size()>1 \">\n" +
" AND o.`customs_type` in\n" +
" <foreach item='customsType' index=\"index\" collection='query.customsType' open='(' separator=',' close=')'>\n" +
" #{customsType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>\n" +
"\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord.size()>0\">\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord != '' and query.productRecord.size()==1 \">\n" +
" AND o.`product_record` =\n" +
" <foreach item='productRecord' index=\"index\" collection='query.productRecord' >\n" +
" #{productRecord}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord != '' and query.productRecord.size()>1 \">\n" +
" AND o.`product_record` in\n" +
" <foreach item='productRecord' index=\"index\" collection='query.productRecord' open='(' separator=',' close=')'>\n" +
" #{productRecord}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
"<when test = 'query.transportId != null'>", "<when test = 'query.transportId != null'>",
"AND o.`transport_id` = #{query.transportId}", "AND o.`transport_id` = #{query.transportId}",
"</when>", "</when>",
"<when test = 'query.channelId != null'>", "<when test = 'query.channelId != null'>",
"AND o.`channel_id` = #{query.channelId}", "AND o.`channel_id` = #{query.channelId}",
"</when>", "</when>",
"<when test = 'query.warehouseType != null'>", // "<when test = 'query.warehouseType != null'>",
"AND o.`warehouse_type` = #{query.warehouseType}", // "AND o.`warehouse_type` = #{query.warehouseType}",
"</when>", // "</when>",
" <if test=\"query.warehouseType != null and query.warehouseType.size()>0\">\n" +
"\n" +
" <if test=\"query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()==1 \">\n" +
" AND o.`warehouse_type` =\n" +
" <foreach item='warehouseType' index=\"index\" collection='query.warehouseType' >\n" +
" #{warehouseType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()>1 \">\n" +
" AND o.`warehouse_type` in\n" +
" <foreach item='warehouseType' index=\"index\" collection='query.warehouseType' open='(' separator=',' close=')'>\n" +
" #{warehouseType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
"<when test = 'query.number != null and query.number != \"\" '>", "<when test = 'query.number != null and query.number != \"\" '>",
"AND (o.`number` like concat('%',concat(#{query.number},'%')) ", "AND (o.`number` like concat('%',concat(#{query.number},'%')) ",
"or ", "or ",
...@@ -4394,15 +4554,49 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -4394,15 +4554,49 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"<when test = 'query.departureId != null '>", "<when test = 'query.departureId != null '>",
"AND de.`departure_id` = #{query.departureId}", "AND de.`departure_id` = #{query.departureId}",
"</when>", "</when>",
"<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>", // "<when test = 'query.type != null and query.type != \"\" and query.type == 0 '>",
"AND (o.type is null or o.type = '' or o.type = '0')", // "AND (o.type is null or o.type = '' or o.type = '0')",
"</when>", // "</when>",
// "<when test = 'query.type == 1 '>", // "<when test = 'query.type == 1 '>",
// "AND FIND_IN_SET(1, o.type)", // "AND FIND_IN_SET(1, o.type)",
// "</when>", // "</when>",
// "<when test = 'query.type == 2 '>", // "<when test = 'query.type == 2 '>",
// "AND FIND_IN_SET(2, o.type)", // "AND FIND_IN_SET(2, o.type)",
// "</when>", // "</when>",
"<if test=\"query.type != null and query.type != '' and query.type.size()>0 \">\n" +
" <if test=\"query.type != null and query.type != '' and query.type.size()>1 \">\n" +
"\n" +
" AND (1 !=1\n" +
" <foreach item='type' index=\"index\" collection='query.type' >\n" +
" <if test=\"type == 0 \">\n" +
" OR (o.type is null or o.type = '' or o.type = '0')\n" +
"\n" +
" </if>\n" +
" <if test=\"type == 1 \">\n" +
" OR FIND_IN_SET(1, o.type)\n" +
" </if>\n" +
" <if test=\"type == 2 \">\n" +
" OR FIND_IN_SET(2, o.type)\n" +
" </if>\n" +
" </foreach>\n" +
" )\n" +
" </if>\n" +
" <if test=\"query.type != null and query.type != '' and query.type.size()==1 \">\n" +
" <foreach item='type' index=\"index\" collection='query.type' >\n" +
" <if test=\"type == 0 \">\n" +
" AND (o.type is null or o.type = '' or o.type = '0')\n" +
"\n" +
" </if>\n" +
" <if test=\"type == 1 \">\n" +
" AND FIND_IN_SET(1, o.type)\n" +
" </if>\n" +
" <if test=\"type == 2 \">\n" +
" AND FIND_IN_SET(2, o.type)\n" +
" </if>\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
// "<when test='query.type != null and query.type != '' and query.type.size()>0 '>" , // "<when test='query.type != null and query.type != '' and query.type.size()>0 '>" ,
// "<if test='query.type != null and query.type != '' and query.type.size()>1 '>" , // "<if test='query.type != null and query.type != '' and query.type.size()>1 '>" ,
// "AND o.type in" , // "AND o.type in" ,
...@@ -4422,9 +4616,22 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -4422,9 +4616,22 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
// "</if>" , // "</if>" ,
// "</if>" , // "</if>" ,
// "</when>", // "</when>",
"<when test = 'query.objectiveId != null '>", // "<when test = 'query.objectiveId != null '>",
"AND ob.`objective_id` = #{query.objectiveId}", // "AND ob.`objective_id` = #{query.objectiveId}",
"</when>", // "</when>",
"<if test=\"query.objectiveId != null and query.objectiveId.size() != 0\">\n" +
" AND ob.`objective_id` in\n" +
" <foreach item='orderId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>\n" +
" #{orderId}\n" +
" </foreach>\n" +
"\n" +
" </if>\n" +
" <if test=\"query.destCountryId != null \">\n" +
" AND ob.`objective_country_id` in\n" +
" <foreach item='destCountryId' index='index' collection='query.destCountryId' open='(' separator=',' close=')'>\n" +
" #{destCountryId}\n" +
" </foreach>\n" +
" </if>",
"<when test = 'query.consignorId != null '>", "<when test = 'query.consignorId != null '>",
"AND nor.`customer_id` = #{query.consignorId} ", "AND nor.`customer_id` = #{query.consignorId} ",
"</when>", "</when>",
...@@ -4602,27 +4809,65 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -4602,27 +4809,65 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})", "or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})",
"))", "))",
"</when>", "</when>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ", // "where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.start_warehouse_id = #{query.startWarehouseId} ", // "where whl.start_warehouse_id = #{query.startWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
"<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>", // "<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.dest_warehouse_id = #{query.destWarehouseId} ", // "where whl.dest_warehouse_id = #{query.destWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
" <if test=\"query.startWarehouseId !=null and query.destWarehouseId !=null \">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.start_warehouse_id in\n" +
" <foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>\n" +
" #{warehouseId}\n" +
" </foreach>\n" +
"\n" +
" and whl.dest_warehouse_id in\n" +
" <foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>\n" +
" #{destWarehouseId}\n" +
" </foreach>\n" +
"\n" +
" ))\n" +
" </if>\n" +
" <if test=\"query.startWarehouseId !=null and query.destWarehouseId==null\">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.start_warehouse_id in\n" +
" <foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>\n" +
" #{warehouseId}\n" +
" </foreach>\n" +
" ))\n" +
" </if>\n" +
" <if test=\"query.startWarehouseId ==null and query.destWarehouseId !=null \">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.dest_warehouse_id in\n" +
" <foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>\n" +
" #{destWarehouseId}\n" +
" </foreach>\n" +
"\n" +
"\n" +
" ))\n" +
" </if>",
"<when test = 'query.airShipment != null and query.airShipment == 1'>", "<when test = 'query.airShipment != null and query.airShipment == 1'>",
"AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ", "AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ",
"</when>", "</when>",
...@@ -5052,70 +5297,230 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -5052,70 +5297,230 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"<when test = 'query.packageType != null and query.packageType != \"\" '>", "<when test = 'query.packageType != null and query.packageType != \"\" '>",
"AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')", "AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')",
"</when>", "</when>",
"<when test = 'query.isExternalWarehouse != null'>", " <if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse.size()>0\">\n" +
"AND o.`is_external_warehouse` = #{query.isExternalWarehouse}", "\n" +
"</when>", " <if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse != '' and query.isExternalWarehouse.size()==1 \">\n" +
"<when test = 'query.status != null'>", " AND o.`is_external_warehouse` =\n" +
"AND o.`status` = #{query.status}", " <foreach item='isExternalWarehouse' index=\"index\" collection='query.isExternalWarehouse' >\n" +
"</when>", " #{isExternalWarehouse}\n" +
"<when test = 'query.abnormalState != null'>", " </foreach>\n" +
"<choose>", " </if>\n" +
"<when test = 'query.abnormalState != 0'>", "\n" +
"<choose>", " <if test=\"query.isExternalWarehouse != null and query.isExternalWarehouse != '' and query.isExternalWarehouse.size()>1 \">\n" +
"<when test = 'query.abnormalState != -1'>", " AND o.`is_external_warehouse` in\n" +
"AND o.`abnormal_state` = #{query.abnormalState}", " <foreach item='isExternalWarehouse' index=\"index\" collection='query.isExternalWarehouse' open='(' separator=',' close=')'>\n" +
"</when>", " #{isExternalWarehouse}\n" +
"<otherwise>", " </foreach>\n" +
"AND o.`abnormal_state` != 0", " </if>\n" +
"</otherwise>", "\n" +
"</choose>", " </if>",
"</when>", // "<when test = 'query.isExternalWarehouse != null'>",
"<otherwise>", // "AND o.`is_external_warehouse` = #{query.isExternalWarehouse}",
"AND o.`abnormal_state` = 0", // "</when>",
"</otherwise>", " <if test=\"query.statusList != null and query.statusList.size()>0\">\n" +
"</choose>", "\n" +
"</when>", " <if test=\"query.statusList != null and query.statusList != '' and query.statusList.size()==1 \">\n" +
" AND o.`status` =\n" +
" <foreach item='status' index=\"index\" collection='query.statusList' >\n" +
" #{status}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.statusList != null and query.statusList != '' and query.statusList.size()>1 \">\n" +
" AND o.`status` in\n" +
" <foreach item='status' index=\"index\" collection='query.statusList' open='(' separator=',' close=')'>\n" +
" #{status}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
// "<when test = 'query.status != null'>",
// "AND o.`status` = #{query.status}",
// "</when>",
" <if test=\"query.abnormalState != null and query.abnormalState.size()>0\">\n" +
"\n" +
" <if test=\"query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()==1 \">\n" +
"\n" +
" <foreach item='abnormalState' index=\"index\" collection='query.abnormalState' >\n" +
"\n" +
" <choose>\n" +
" <when test=\"abnormalState != '0'\">\n" +
" <choose>\n" +
" <when test=\"abnormalState != '-1'\">\n" +
" AND o.`abnormal_state` = #{abnormalState}\n" +
" </when>\n" +
" <otherwise>\n" +
" AND o.`abnormal_state` != 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </when>\n" +
" <otherwise>\n" +
" AND o.`abnormal_state` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()>1 \">\n" +
" AND (1!=1\n" +
" <foreach item='abnormalState' index=\"index\" collection='query.abnormalState'>\n" +
"\n" +
" <choose>\n" +
" <when test=\"abnormalState != '0'\">\n" +
" <choose>\n" +
" <when test=\"abnormalState != '-1'\">\n" +
" OR o.`abnormal_state` = #{abnormalState}\n" +
" </when>\n" +
" <otherwise>\n" +
" OR o.`abnormal_state` != 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </when>\n" +
" <otherwise>\n" +
" OR o.`abnormal_state` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
"\n" +
" )\n" +
" </if>\n" +
"\n" +
" </if>",
// "<when test = 'query.abnormalState != null'>",
// "<choose>",
// "<when test = 'query.abnormalState != 0'>",
// "<choose>",
// "<when test = 'query.abnormalState != -1'>",
// "AND o.`abnormal_state` = #{query.abnormalState}",
// "</when>",
// "<otherwise>",
// "AND o.`abnormal_state` != 0",
// "</otherwise>",
// "</choose>",
// "</when>",
// "<otherwise>",
// "AND o.`abnormal_state` = 0",
// "</otherwise>",
// "</choose>",
// "</when>",
"<when test = 'query.inWarehouseState != null'>", "<when test = 'query.inWarehouseState != null'>",
"AND o.`in_warehouse_state` = #{query.inWarehouseState}", "AND o.`in_warehouse_state` = #{query.inWarehouseState}",
"</when>", "</when>",
"<when test = 'query.shipmentState != null'>", "<when test = 'query.shipmentState != null'>",
"AND o.`shipment_State` = #{query.shipmentState}", "AND o.`shipment_State` = #{query.shipmentState}",
"</when>", "</when>",
"<when test = 'query.auditType != null'>", " <if test=\"query.auditType != null and query.auditType.size()>0\">\n" +
"<choose>", "\n" +
"<when test = 'query.auditType != 0'>", " <if test=\"query.auditType != null and query.auditType != '' and query.auditType.size()==1 \">\n" +
"<choose>", "\n" +
"<when test = 'query.auditType != -1'>", " <foreach item='auditType' index=\"index\" collection='query.auditType' >\n" +
"AND o.`audit_type` = #{query.auditType}", "\n" +
"</when>", " <choose>\n" +
"<otherwise>", " <when test=\"auditType != 0\">\n" +
"AND o.`audit_type` != 0", " <choose>\n" +
"</otherwise>", " <when test=\"auditType != -1\">\n" +
"</choose>", " AND o.`audit_type` = #{auditType}\n" +
"</when>", " </when>\n" +
"<otherwise>", " <otherwise>\n" +
"AND o.`audit_type` = 0", " AND o.`audit_type` != 0\n" +
"</otherwise>", " </otherwise>\n" +
"</choose>", " </choose>\n" +
"</when>", " </when>\n" +
" <otherwise>\n" +
" AND o.`audit_type` = 0\n" +
" </otherwise>\n" +
" </choose>\n" +
" </foreach>\n" +
" </if>\n" +
" </if>",
// "<when test = 'query.auditType != null'>",
// "<choose>",
// "<when test = 'query.auditType != 0'>",
// "<choose>",
// "<when test = 'query.auditType != -1'>",
// "AND o.`audit_type` = #{query.auditType}",
// "</when>",
// "<otherwise>",
// "AND o.`audit_type` != 0",
// "</otherwise>",
// "</choose>",
// "</when>",
// "<otherwise>",
// "AND o.`audit_type` = 0",
// "</otherwise>",
// "</choose>",
// "</when>",
"<when test = 'query.salesmanId != null '>", "<when test = 'query.salesmanId != null '>",
"AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))", "AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))",
"</when>", "</when>",
"<when test = 'query.customsType != null'>", // "<when test = 'query.customsType != null'>",
"AND o.`customs_type` = #{query.customsType}", // "AND o.`customs_type` = #{query.customsType}",
"</when>", // "</when>",
"<when test = 'query.productRecord != null'>", // "<when test = 'query.productRecord != null'>",
"AND o.`product_record` = #{query.productRecord}", // "AND o.`product_record` = #{query.productRecord}",
"</when>", // "</when>",
" <if test=\"query.customsType != null and query.customsType.size()>0\">\n" +
"\n" +
" <if test=\"query.customsType != null and query.customsType != '' and query.customsType.size()==1 \">\n" +
" AND o.`customs_type` =\n" +
" <foreach item='customsType' index=\"index\" collection='query.customsType' >\n" +
" #{customsType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.customsType != null and query.customsType != '' and query.customsType.size()>1 \">\n" +
" AND o.`customs_type` in\n" +
" <foreach item='customsType' index=\"index\" collection='query.customsType' open='(' separator=',' close=')'>\n" +
" #{customsType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>\n" +
"\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord.size()>0\">\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord != '' and query.productRecord.size()==1 \">\n" +
" AND o.`product_record` =\n" +
" <foreach item='productRecord' index=\"index\" collection='query.productRecord' >\n" +
" #{productRecord}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.productRecord != null and query.productRecord != '' and query.productRecord.size()>1 \">\n" +
" AND o.`product_record` in\n" +
" <foreach item='productRecord' index=\"index\" collection='query.productRecord' open='(' separator=',' close=')'>\n" +
" #{productRecord}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
"<when test = 'query.transportId != null'>", "<when test = 'query.transportId != null'>",
"AND o.`transport_id` = #{query.transportId}", "AND o.`transport_id` = #{query.transportId}",
"</when>", "</when>",
"<when test = 'query.channelId != null'>", "<when test = 'query.channelId != null'>",
"AND o.`channel_id` = #{query.channelId}", "AND o.`channel_id` = #{query.channelId}",
"</when>", "</when>",
"<when test = 'query.warehouseType != null'>", // "<when test = 'query.warehouseType != null'>",
"AND o.`warehouse_type` = #{query.warehouseType}", // "AND o.`warehouse_type` = #{query.warehouseType}",
"</when>", // "</when>",
" <if test=\"query.warehouseType != null and query.warehouseType.size()>0\">\n" +
"\n" +
" <if test=\"query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()==1 \">\n" +
" AND o.`warehouse_type` =\n" +
" <foreach item='warehouseType' index=\"index\" collection='query.warehouseType' >\n" +
" #{warehouseType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" <if test=\"query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()>1 \">\n" +
" AND o.`warehouse_type` in\n" +
" <foreach item='warehouseType' index=\"index\" collection='query.warehouseType' open='(' separator=',' close=')'>\n" +
" #{warehouseType}\n" +
" </foreach>\n" +
" </if>\n" +
"\n" +
" </if>",
"<when test = 'query.number != null and query.number != \"\" '>", "<when test = 'query.number != null and query.number != \"\" '>",
"AND (o.`number` like concat('%',concat(#{query.number},'%')) ", "AND (o.`number` like concat('%',concat(#{query.number},'%')) ",
"or ", "or ",
...@@ -5149,6 +5554,12 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -5149,6 +5554,12 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"AND ob.`objective_id` IN", "AND ob.`objective_id` IN",
"<foreach item='objectiveId' collection='query.objectiveId' open='(' close=')' separator=','> #{objectiveId} </foreach>", "<foreach item='objectiveId' collection='query.objectiveId' open='(' close=')' separator=','> #{objectiveId} </foreach>",
"</when>", "</when>",
"<if test=\"query.destCountryId != null \">\n" +
" AND ob.`objective_country_id` in\n" +
" <foreach item='destCountryId' index='index' collection='query.destCountryId' open='(' separator=',' close=')'>\n" +
" #{destCountryId}\n" +
" </foreach>\n" +
" </if>",
"<when test = 'query.consignorId != null '>", "<when test = 'query.consignorId != null '>",
"AND nor.`customer_id` = #{query.consignorId} ", "AND nor.`customer_id` = #{query.consignorId} ",
"</when>", "</when>",
...@@ -5320,27 +5731,65 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -5320,27 +5731,65 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})", "or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})",
"))", "))",
"</when>", "</when>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId != null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ", // "where whl.start_warehouse_id = #{query.startWarehouseId} and whl.dest_warehouse_id = #{query.destWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
"<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>", // "<when test = 'query.startWarehouseId != null and query.destWarehouseId == null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.start_warehouse_id = #{query.startWarehouseId} ", // "where whl.start_warehouse_id = #{query.startWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
"<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>", // "<when test = 'query.startWarehouseId == null and query.destWarehouseId != null '>",
"and (o.line_id in(", // "and (o.line_id in(",
"select whl.id ", // "select whl.id ",
"from ecw_warehouse_line whl ", // "from ecw_warehouse_line whl ",
"where whl.dest_warehouse_id = #{query.destWarehouseId} ", // "where whl.dest_warehouse_id = #{query.destWarehouseId} ",
"))", // "))",
"</when>", // "</when>",
" <if test=\"query.startWarehouseId !=null and query.destWarehouseId !=null \">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.start_warehouse_id in\n" +
" <foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>\n" +
" #{warehouseId}\n" +
" </foreach>\n" +
"\n" +
" and whl.dest_warehouse_id in\n" +
" <foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>\n" +
" #{destWarehouseId}\n" +
" </foreach>\n" +
"\n" +
" ))\n" +
" </if>\n" +
" <if test=\"query.startWarehouseId !=null and query.destWarehouseId==null\">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.start_warehouse_id in\n" +
" <foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>\n" +
" #{warehouseId}\n" +
" </foreach>\n" +
" ))\n" +
" </if>\n" +
" <if test=\"query.startWarehouseId ==null and query.destWarehouseId !=null \">\n" +
" and (o.line_id in(\n" +
" select whl.id\n" +
" from ecw_warehouse_line whl\n" +
" where whl.dest_warehouse_id in\n" +
" <foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>\n" +
" #{destWarehouseId}\n" +
" </foreach>\n" +
"\n" +
"\n" +
" ))\n" +
" </if>",
"<when test = 'query.airShipment != null and query.airShipment == 1'>", "<when test = 'query.airShipment != null and query.airShipment == 1'>",
"AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ", "AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0 ",
"</when>", "</when>",
......
...@@ -884,7 +884,9 @@ ...@@ -884,7 +884,9 @@
) )
</if> </if>
<include refid="myOrderQuery"/> <include refid="myOrderQuery"/>
GROUP BY o.order_id
order by o.order_id desc order by o.order_id desc
limit #{start}, #{size} limit #{start}, #{size}
</select> </select>
...@@ -4376,4 +4378,6 @@ ...@@ -4376,4 +4378,6 @@
<if test = "query.userType == 2 "> <if test = "query.userType == 2 ">
</if> </if>
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment