Files
TimiServerAPI/src/main/resources/mapper/timi-server/gao/GaoPointRuleMapper.xml
T
2026-09-04 20:38:17 +08:00

31 lines
1.1 KiB
XML

<?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.imyeyu.api.modules.gao.mapper.GaoPointRuleMapper">
<select id="selectByIdList" resultType="com.imyeyu.api.modules.gao.entity.GaoPointRule">
SELECT *
FROM gao_point_rule
WHERE deleted_at IS NULL
AND id IN
<foreach collection="idList" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
<select id="selectActiveByTrigger" resultType="com.imyeyu.api.modules.gao.entity.GaoPointRule">
SELECT *
FROM `gao_point_rule`
WHERE `store_id` = #{storeId}
AND `trigger_source_type` = #{triggerSourceType}
AND (`trigger_ref_id` IS NULL
<if test="triggerRefId != null and triggerRefId != ''">
OR `trigger_ref_id` = #{triggerRefId}
</if>
)
AND `status` = 'ACTIVE'
AND (`begin_at` IS NULL OR `begin_at` &lt;= #{now})
AND (`end_at` IS NULL OR #{now} &lt;= `end_at`)
AND `deleted_at` IS NULL
ORDER BY `priority`, `created_at`, `id`
</select>
</mapper>