Files
TimiServerAPI/src/main/resources/mapper/timi-server/GaoEventMapper.xml
T
2026-08-07 11:37:54 +08:00

35 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.GaoEventMapper">
<select id="selectByIdList" resultType="com.imyeyu.api.modules.gao.entity.GaoEvent">
SELECT
*
FROM `gao_event`
WHERE
TRUE
<if test="idList != null and !idList.isEmpty()">
AND `id` IN
<foreach collection="idList" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
<if test="idList == null or idList.isEmpty()">
AND FALSE
</if>
AND `deleted_at` IS NULL
</select>
<select id="selectValidList" resultType="com.imyeyu.api.modules.gao.entity.GaoEvent">
SELECT
*
FROM `gao_event`
WHERE
`store_id` = #{storeId}
AND `status` = '${@com.imyeyu.api.modules.gao.entity.GaoEvent$Status@ACTIVE.name()}'
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 `sort`, `created_at`
</select>
</mapper>