|  | @@ -17,18 +17,19 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <update id="updateOrderBillsPlansByid">
 | 
	
		
			
				|  |  |          update OrderBillsPlans
 | 
	
		
			
				|  |  | -        set LoadQty       = #{loadQty},
 | 
	
		
			
				|  |  | -            LoadDate      = #{loadDate},
 | 
	
		
			
				|  |  | -            UnLoadQty     = #{unLoadQty},
 | 
	
		
			
				|  |  | -            UnLoadDate    = #{unLoadDate},
 | 
	
		
			
				|  |  | -            <if test="ifDetour != null and ifDetour != ''">
 | 
	
		
			
				|  |  | -                ifDetour      = #{ifDetour},
 | 
	
		
			
				|  |  | -                detourMile      = #{detourMile},
 | 
	
		
			
				|  |  | -                detourDesc      = #{detourDesc},
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -            driverassdesc = #{driverassdesc}
 | 
	
		
			
				|  |  | +        set LoadQty = #{loadQty},
 | 
	
		
			
				|  |  | +        LoadDate = #{loadDate},
 | 
	
		
			
				|  |  | +        UnLoadQty = #{unLoadQty},
 | 
	
		
			
				|  |  | +        UnLoadDate = #{unLoadDate},
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        <if test="ifDetour != null and ifDetour != ''">
 | 
	
		
			
				|  |  | +            ifDetour = #{ifDetour},
 | 
	
		
			
				|  |  | +            detourMile = #{detourMile},
 | 
	
		
			
				|  |  | +            detourDesc = #{detourDesc},
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        driverassdesc = #{driverassdesc}
 | 
	
		
			
				|  |  |          where sysId = '1'
 | 
	
		
			
				|  |  | -          and OrderNo = #{orderNo}
 | 
	
		
			
				|  |  | +        and OrderNo = #{orderNo}
 | 
	
		
			
				|  |  |      </update>
 | 
	
		
			
				|  |  |      <update id="updateOrderBillsPlansByOrderNo">
 | 
	
		
			
				|  |  |          update OrderBillsPlans
 | 
	
	
		
			
				|  | @@ -140,9 +141,9 @@
 | 
	
		
			
				|  |  |          , p.rightqty
 | 
	
		
			
				|  |  |          , b.billStatus
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        , p.ifLoaded      ifLoaded
 | 
	
		
			
				|  |  | -        , p.ifUnLoaded    ifUnLoaded
 | 
	
		
			
				|  |  | -        , p.ifStarted     ifStarted
 | 
	
		
			
				|  |  | +        , p.ifLoaded ifLoaded
 | 
	
		
			
				|  |  | +        , p.ifUnLoaded ifUnLoaded
 | 
	
		
			
				|  |  | +        , p.ifStarted ifStarted
 | 
	
		
			
				|  |  |          from wf_TaskList t
 | 
	
		
			
				|  |  |          Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
 | 
	
		
			
				|  |  |          Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
 | 
	
	
		
			
				|  | @@ -159,10 +160,30 @@
 | 
	
		
			
				|  |  |              t.SysID=1
 | 
	
		
			
				|  |  |              <if test="type == 'BD'">
 | 
	
		
			
				|  |  |                  and t.ActID=317
 | 
	
		
			
				|  |  | +                <if test="flowType == '未装车'">
 | 
	
		
			
				|  |  | +                    and p.ifLoaded = 'F' and p.ifUnLoaded = 'F'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  | +                <if test="flowType == '未卸车'">
 | 
	
		
			
				|  |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'F'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  | +                <if test="flowType == '已卸车'">
 | 
	
		
			
				|  |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'T'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="type == 'BX'">
 | 
	
		
			
				|  |  |                  and t.ActID = #{actId, jdbcType=VARCHAR}
 | 
	
		
			
				|  |  | -                and (p.ifStarted = 'F' or p.ifStarted = 'S' or p.ifStarted = 'A' or p.ifStarted = 'B')
 | 
	
		
			
				|  |  | +                <if test="flowType == '未提交'">
 | 
	
		
			
				|  |  | +                    and p.ifStarted = 'F'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  | +                <if test="flowType == '已提交'">
 | 
	
		
			
				|  |  | +                    and p.ifStarted = 'S'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  | +                <if test="flowType == '已通过'">
 | 
	
		
			
				|  |  | +                    and p.ifStarted = 'A'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  | +                <if test="flowType == '已退回'">
 | 
	
		
			
				|  |  | +                    and p.ifStarted = 'B'
 | 
	
		
			
				|  |  | +                </if>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              and ((b.CarID=-1) or ((b.CarID <> -1)))
 | 
	
		
			
				|  |  |              <if test="dataStart != null and dataStart != '' and dataEnd != null and dataEnd != ''">
 | 
	
	
		
			
				|  | @@ -291,6 +312,11 @@
 | 
	
		
			
				|  |  |               , o.loadAddr   loadAddr
 | 
	
		
			
				|  |  |               , o.unLoadAddr unLoadAddr
 | 
	
		
			
				|  |  |               , g.CName goodsCName
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +             , o.loadQty loadQty
 | 
	
		
			
				|  |  | +             , o.loadDate loadDate
 | 
	
		
			
				|  |  | +             , o.unLoadQty unLoadQty
 | 
	
		
			
				|  |  | +             , o.unLoadDate unLoadDate
 | 
	
		
			
				|  |  |          FROM OrderBillsPlans o
 | 
	
		
			
				|  |  |                   INNER JOIN LoadBills b
 | 
	
		
			
				|  |  |                              ON
 |