tangchuanxing_branch
CR7 9 months ago
parent 582414af9d
commit 0ba47f9361

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 定义XML文档类型为MyBatis的mapper指定了DTD的URL -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 定义了一个mapper元素指定了namespace这个namespace对应于Mapper接口的全路径 -->
<mapper namespace="com.yami.shop.dao.HotSearchMapper">
<!-- 定义了一个查询操作用于根据店铺ID获取热搜DTO -->
<select id="getHotSearchDtoByShopId" resultType="com.yami.shop.bean.dto.HotSearchDto">
<!-- 查询语句选择hot_search_id, content, title字段 -->
SELECT
hot_search_id,
content,
title
<!-- 从tz_hot_search表中查询 -->
FROM
tz_hot_search
<!-- 条件是shop_id等于传入的shopId参数并且status字段等于1 -->
WHERE
shop_id = #{shopId}
AND `status` = 1
<!-- 按照seq字段排序 -->
ORDER BY
seq
</select>
</mapper>
Loading…
Cancel
Save