<!-- 按照条件查询活动,使用Activity类来接查询结果 -->
<select id="selectActivityDoPagination" parameterType="java.lang.String" resultMap="activity">
select
ID,
ACTIVITY_CODE,
ACTIVITY_NAME,
ACTIVITY_DESCRIPTION,
CASE(INDIRECT_RECOMMEND) WHEN '1' THEN '是' ELSE '否' END AS INDIRECT_RECOMMEND,
to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') CREATE_TIME,
to_char(LAST_MODIFIED,'yyyy-mm-dd hh24:mi:ss') LAST_MODIFIED,
BANNER_PATH
from
ACTIVITY
where 1=1
<if test="activity.activityCode != null and activity.activityCode != ''">
and ACTIVITY_CODE=#{activity.activityCode}
</if>
<if test="activity.activityName != null and activity.activityName != ''">
and ACTIVITY_NAME=#{activity.activityName}
</if>
<if test="activity.indirectRecommend != null and activity.indirectRecommend != ''">
and INDIRECT_RECOMMEND=#{activity.indirectRecommend}
</if>
<if test="activity.createTime != null and activity.createTime != ''">
and TO_CHAR(CREATE_TIME,'YYYY-MM-DD') = '${activity.createTime}'
</if>
<if test="activity.lastModified != null and activity.lastModified != ''">
and TO_CHAR(LAST_MODIFIED,'YYYY-MM-DD') = '${activity.lastModified}'
</if>
order by ID asc
</select>
case when else表达式
最新推荐文章于 2023-06-20 16:49:26 发布