SELECT channel_order_id,transfer_order_id FROM `dc_base_cost_first` WHERE cost_first>0 and has_calculation = 0 GROUP BY channel_order_id,transfer_order_id ORDER BY transfer_order_id asc limit #{v1}, #{v2};
SELECT channel_order_id,transfer_order_id, box_id, warehouse_code FROM `dc_base_cost_first` WHERE cost_first>0 and has_calculation = 0 GROUP BY channel_order_id,transfer_order_id, box_id, warehouse_code ORDER BY transfer_order_id asc limit #{v1}, #{v2};
</select>
</select>
<selectid="countChannelOrder"resultType="int">
<selectid="countChannelOrder"resultType="int">
SELECT COUNT(*) FROM (SELECT channel_order_id,transfer_order_id FROM `dc_base_cost_first` WHERE cost_first>0 and has_calculation = 0 GROUP BY channel_order_id,transfer_order_id) tb;
SELECT COUNT(*) FROM (SELECT channel_order_id,transfer_order_id, box_id, warehouse_code FROM `dc_base_cost_first` WHERE cost_first>0 and has_calculation = 0 GROUP BY channel_order_id,transfer_order_id, box_id, warehouse_code) tb;
</select>
</select>
<updateid="updateHasCalculation">
<updateid="updateHasCalculation">
update dc_base_cost_first set has_calculation = 1 where channel_order_id = #{channelOrderId} and transfer_order_id = #{transferOrderId} and has_calculation = 0
update dc_base_cost_first set has_calculation = 1 where channel_order_id = #{channelOrderId} and transfer_order_id = #{transferOrderId} and box_id = #{boxId} and warehouse_code = #{warehouseCode} and has_calculation = 0