<?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 >=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and end_time <= #{endTime}
</if>
<if test="createStartTime!=null">
and create_time >= #{createStartTime}
</if>
<if test="createEndTime!=null">
and create_time <=#{createEndTime}
</if>
</select>
</mapper>
<!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 >=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and end_time <= #{endTime}
</if>
<if test="createStartTime!=null">
and create_time >= #{createStartTime}
</if>
<if test="createEndTime!=null">
and create_time <=#{createEndTime}
</if>
</select>
</mapper>