<select id="getRiverLog" resultType="com.wochanye.riverAdmin.vo.OutfallLogEnterpriseVo" parameterType="map">
SELECT
a.*,
b.`name`,
b.country,
b.type as intoRiverMode
FROM water_ecology_outfall_log AS a LEFT JOIN water_ecology_outfall_river AS b ON a.object_id = b.id
where a.type = 2
<if test="yearMonth != null" >
and DATE_FORMAT(log_time, '%Y-%m') = #{yearMonth}
</if>
and a.`status` = 1
and b.`status` = 1
<if test="country != null" >
and b.country = #{country}
</if>
<if test="intoRiverMode != null" >
and b.type = #{intoRiverMode}
</if>
order by a.log_time desc
</select>
日期取取2位进行匹配
最新推荐文章于 2024-09-24 08:39:48 发布