mybatis_mysql

SELECT round(avg(c.AVG_DELAY_TIME)) as AVG_DELAY FROM `result_road_saturation_day` a LEFT JOIN info_road_area d ON a.ROAD_CODE=d.ROAD_CODE LEFT JOIN info_area e ON e.AREA_CODE=d.AREA_CODE LEFT JOIN result_road_delay_day c ON a.ROAD_CODE=c.ROAD_CODE <where>
<if test="areaid != null and areaid != ''"> and e.AREA_CODE like concat('%',#{areaid},'%') </if> and DATE_FORMAT(a.BEGIN_TIME,'%Y-%m-%d') &gt;= #{afBeginTime} AND DATE_FORMAT(a.END_TIME,'%Y-%m-%d') &lt;= #{afEndTime} AND a.DURATION_TYPE in('3','4') AND a.ROAD_CODE IN <foreach collection="strings" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach>
</where>
相關文章
相關標籤/搜索