Commit 34099b02 authored by liuzeheng's avatar liuzeheng

订单状态

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