ylx 7 năm trước cách đây
mục cha
commit
ae67bb0cfb

+ 7 - 7
saicLogistics/src/main/java/com/fuzamei/mapper/CargoConsignMapper.xml

@@ -14,7 +14,7 @@
 			o.status_id,
 			s.status_name
 		from 
-			orders o
+			(select * from orders where status_id!=1) o
 		left join 
 			status s
 		on 
@@ -46,20 +46,20 @@
 		select 
 			count(*)
 		from 
-			orders
+			(select * from orders where status_id!=1) o
 		<where>
-			supplier_id=#{userId}
+			o.supplier_id=#{userId}
 			<if test="orderId!=null">
-				and order_id=#{orderId}
+				and o.order_id=#{orderId}
 			</if>
 			<if test="boxNo!=null and boxNo!=''">
-				and box_no=#{boxNo}
+				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">
-				and status_id=#{statusId}
+				and o.status_id=#{statusId}
 			</if>
 			<if test="startTime!=null and endTime!=null">
-				and require_time between #{startTime} and #{endTime}
+				and o.require_time between #{startTime} and #{endTime}
 			</if>
 		</where>
 	</select>

+ 7 - 7
saicLogistics/src/main/java/com/fuzamei/mapper/CargoDeliverMapper.xml

@@ -12,7 +12,7 @@
 			o.update_time,
 			s.status_name
 		from 
-			orders o
+			(select * from orders where status_id not in (1,2)) o
 		left join 
 			status s
 		on 
@@ -41,20 +41,20 @@
 		select 
 			count(*)
 		from 
-			orders
+			(select * from orders where status_id not in (1,2)) o
 		<where>
-			carrier_id=#{userId}
+			o.carrier_id=#{userId}
 			<if test="orderId!=null">
-				and order_id=#{orderId}
+				and o.order_id=#{orderId}
 			</if>
 			<if test="carNo!=null and carNo!=''">
-				and car_no=#{carNo}
+				and o.car_no=#{carNo}
 			</if>
 			<if test="statusId!=null">
-				and status_id=#{statusId}
+				and o.status_id=#{statusId}
 			</if>
 			<if test="startTime!=null and endTime!=null">
-				and require_time between #{startTime} and #{endTime}
+				and o.require_time between #{startTime} and #{endTime}
 			</if>
 		</where>
 	</select>

+ 7 - 7
saicLogistics/src/main/java/com/fuzamei/mapper/CargoTallyMapper.xml

@@ -13,7 +13,7 @@
 			o.update_time,
 			s.status_name
 		from 
-			orders o
+			(select * from orders where status_id not in (1,2,3)) o
 		left join 
 			status s
 		on 
@@ -41,20 +41,20 @@
 		select 
 			count(*)
 		from 
-			orders
+			(select * from orders where status_id not in (1,2,3)) o
 		<where>
-			receiver_id=#{userId}
+			o.receiver_id=#{userId}
 			<if test="orderId!=null">
-				and order_id=#{orderId}
+				and o.order_id=#{orderId}
 			</if>
 			<if test="boxNo!=null and boxNo!=''">
-				and box_no=#{boxNo}
+				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">
-				and status_id=#{statusId}
+				and o.status_id=#{statusId}
 			</if>
 			<if test="startTime!=null and endTime!=null">
-				and require_time between #{startTime} and #{endTime}
+				and o.require_time between #{startTime} and #{endTime}
 			</if>
 		</where>
 	</select>

+ 1 - 1
saicLogistics/src/main/java/com/fuzamei/web/CargoConsignAction.java

@@ -152,7 +152,7 @@ public class CargoConsignAction {
 			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(userId), Role.CARRIER);
 			params.setUserId(Integer.parseInt(userId));
 			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(params.getOrderId()));
-			ValidationUtil.checkBlankAndAssignString(params.getCarNo());//车牌号校验
+			ValidationUtil.checkBlankAndAssignString(params.getCarNo(),CARNO_PATTERN);//车牌号校验
 			if(order==null) throw new RuntimeException("订单不存在");
 			if(!Statuses.UNDELIVER.equals(order.getStatusId())) throw new RuntimeException("非法操作");
 			if(!params.getUserId().equals(order.getCarrierId())) throw new RuntimeException("无权操作");