sql语句

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sinoauto.dao.mapper.ActActivityMapper">
<select id="selectActActivityList" resultType="com.sinoauto.dto.ActActivityResultDto">
select
activity_id,
activity_name,
activity_desc,
case activity_type
when 1
then '充值活动'
when 2 then '推荐活动'
when 3 then '问卷活动'
when 4 then '抽奖活动'
when
5 then '促销活动'
end as activity_type,
case is_long_term
when 0 then
concat(start_time,'~',end_time)
when 1 then '长期有效'
end as is_long_term,
case activity_status
when 1 then '进行中'
when 2 then '待开始'
when 3 then
'已结束'
end as activity_status,
case is_enable
when 0 then '停用'
when 1 then
'启用'
end as is_enable,
join_num,
activity_strategy,
enable_type,
enable_time,
create_time,
update_time,
dml_flag
from act_activity
where 1=1
and dml_flag!=3
<if test="activityName!=null and activityName!=''">
and activity_name like concat ('%',#{activityName},'%')
</if>
<if test="activityType!=null and activityType!=''">
and activity_type =#{activityType}
</if>
<if test="isEnable==false">
and is_enable =0
</if>
<if test="isEnable==true">
and is_enable =1
</if>
<if test="activityStatus!=null and activityStatus!=''">
and activity_status=#{activityStatus}
</if>
<if test="startTime!=null and startTime!=''">
and start_time &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and end_time &lt;= #{endTime}
</if>
<if test="createStartTime!=null">
and create_time &gt;= #{createStartTime}
</if>
<if test="createEndTime!=null">
and create_time &lt;=#{createEndTime}
</if>
</select>
</mapper>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值