|
@@ -24,22 +24,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<sql id="selectPointActivityTaskVo">
|
|
<sql id="selectPointActivityTaskVo">
|
|
|
select id, activity_id, task_name, task_value, trigger_name, trigger_value, reward_points, frequency_limit_name, frequency_limit_value, sort_order, is_deleted, create_time, update_time, status from point_activity_task
|
|
select id, activity_id, task_name, task_value, trigger_name, trigger_value, reward_points, frequency_limit_name, frequency_limit_value, sort_order, is_deleted, create_time, update_time, status from point_activity_task
|
|
|
</sql>
|
|
</sql>
|
|
|
-
|
|
|
|
|
- <select id="selectPointActivityTaskList" parameterType="PointActivityTask" resultMap="PointActivityTaskResult">
|
|
|
|
|
- <include refid="selectPointActivityTaskVo"/>
|
|
|
|
|
- <where>
|
|
|
|
|
- <if test="activityId != null "> and activity_id = #{activityId}</if>
|
|
|
|
|
- <if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
|
|
|
|
- <if test="taskValue != null and taskValue != ''"> and task_value = #{taskValue}</if>
|
|
|
|
|
- <if test="triggerName != null and triggerName != ''"> and trigger_name like concat('%', #{triggerName}, '%')</if>
|
|
|
|
|
- <if test="triggerValue != null and triggerValue != ''"> and trigger_value = #{triggerValue}</if>
|
|
|
|
|
- <if test="rewardPoints != null "> and reward_points = #{rewardPoints}</if>
|
|
|
|
|
- <if test="frequencyLimitName != null and frequencyLimitName != ''"> and frequency_limit_name like concat('%', #{frequencyLimitName}, '%')</if>
|
|
|
|
|
- <if test="frequencyLimitValue != null and frequencyLimitValue != ''"> and frequency_limit_value = #{frequencyLimitValue}</if>
|
|
|
|
|
- <if test="sortOrder != null "> and sort_order = #{sortOrder}</if>
|
|
|
|
|
- <if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
|
|
|
|
- </where>
|
|
|
|
|
- </select>
|
|
|
|
|
|
|
|
|
|
<select id="selectPointActivityTaskById" parameterType="String" resultMap="PointActivityTaskResult">
|
|
<select id="selectPointActivityTaskById" parameterType="String" resultMap="PointActivityTaskResult">
|
|
|
<include refid="selectPointActivityTaskVo"/>
|
|
<include refid="selectPointActivityTaskVo"/>
|
|
@@ -87,26 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
- <update id="updatePointActivityTask" parameterType="PointActivityTask">
|
|
|
|
|
- update point_activity_task
|
|
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
- <if test="activityId != null">activity_id = #{activityId},</if>
|
|
|
|
|
- <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
|
|
|
|
- <if test="taskValue != null and taskValue != ''">task_value = #{taskValue},</if>
|
|
|
|
|
- <if test="triggerName != null and triggerName != ''">trigger_name = #{triggerName},</if>
|
|
|
|
|
- <if test="triggerValue != null and triggerValue != ''">trigger_value = #{triggerValue},</if>
|
|
|
|
|
- <if test="rewardPoints != null">reward_points = #{rewardPoints},</if>
|
|
|
|
|
- <if test="frequencyLimitName != null and frequencyLimitName != ''">frequency_limit_name = #{frequencyLimitName},</if>
|
|
|
|
|
- <if test="frequencyLimitValue != null and frequencyLimitValue != ''">frequency_limit_value = #{frequencyLimitValue},</if>
|
|
|
|
|
- <if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
|
|
|
- <if test="isDeleted != null">is_deleted = #{isDeleted},</if>
|
|
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
- <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
- <if test="status != null">status = #{status},</if>
|
|
|
|
|
- </trim>
|
|
|
|
|
- where id = #{id}
|
|
|
|
|
- </update>
|
|
|
|
|
-
|
|
|
|
|
<delete id="deletePointActivityTaskById" parameterType="String">
|
|
<delete id="deletePointActivityTaskById" parameterType="String">
|
|
|
delete from point_activity_task where id = #{id}
|
|
delete from point_activity_task where id = #{id}
|
|
|
</delete>
|
|
</delete>
|
|
@@ -122,13 +86,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectTasksByActivityType" resultType="com.ylx.point.domain.PointActivityTask">
|
|
<select id="selectTasksByActivityType" resultType="com.ylx.point.domain.PointActivityTask">
|
|
|
- <include refid="selectPointActivityTaskVo"/>
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ t.id,
|
|
|
|
|
+ t.activity_id,
|
|
|
|
|
+ t.task_name,
|
|
|
|
|
+ t.task_value,
|
|
|
|
|
+ t.trigger_name,
|
|
|
|
|
+ t.trigger_value,
|
|
|
|
|
+ t.reward_points,
|
|
|
|
|
+ t.frequency_limit_name,
|
|
|
|
|
+ t.frequency_limit_value,
|
|
|
|
|
+ t.sort_order,
|
|
|
|
|
+ t.status,
|
|
|
|
|
+ t.is_deleted,
|
|
|
|
|
+ t.create_time,
|
|
|
|
|
+ t.update_time
|
|
|
|
|
+ FROM
|
|
|
|
|
+ point_activity_task t
|
|
|
|
|
+ INNER JOIN point_activity a ON t.activity_id = a.id
|
|
|
WHERE
|
|
WHERE
|
|
|
- activity_id = #{activityType}
|
|
|
|
|
- AND status = 1
|
|
|
|
|
|
|
+ a.activity_type = #{activityType}
|
|
|
|
|
+ AND t.is_deleted = 0
|
|
|
|
|
+ AND t.status = 0
|
|
|
|
|
+ AND a.status = 1
|
|
|
ORDER BY
|
|
ORDER BY
|
|
|
- sort_order ASC, -- 按排序字段正序排列
|
|
|
|
|
- id ASC -- 二级排序,保证顺序稳定
|
|
|
|
|
|
|
+ t.sort_order ASC, -- 按排序字段正序排列
|
|
|
|
|
+ t.id ASC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|