tangchuanxing_branch
CR7 9 months ago
parent ff5d5aa8c1
commit 193c03408d

@ -0,0 +1,40 @@
<?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.IndexImgMapper">
<!-- 定义了一个resultMap用于将数据库结果集的列映射到Java对象的属性 -->
<resultMap id="BaseResultMap" type="com.yami.shop.bean.model.IndexImg">
<!--
这是一个警告注释由MyBatis Generator自动生成。
@mbg.generated 表示这个resultMap是由MyBatis Generator工具自动生成的警告开发者不要手动修改。
-->
<id column="img_id" jdbcType="BIGINT" property="imgId"/>
<result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
<result column="des" jdbcType="VARCHAR" property="des"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="link" jdbcType="VARCHAR" property="link"/>
<result column="status" jdbcType="BIT" property="status"/>
<result column="seq" jdbcType="INTEGER" property="seq"/>
<result column="upload_time" jdbcType="TIMESTAMP" property="uploadTime"/>
<result column="relation" jdbcType="BIGINT" property="relation"/>
<result column="type" jdbcType="INTEGER" property="type"/>
</resultMap>
<!-- 定义了一个删除操作用于根据ID列表删除索引图片 -->
<delete id="deleteIndexImgByIds">
delete from tz_index_img where img_id in
<!-- 使用foreach循环遍历ID列表并生成IN语句中的条件 -->
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</delete>
<!-- 定义了一个查询操作用于获取状态为1的所有索引图片并按顺序排序 -->
<select id="listIndexImg" resultType="com.yami.shop.bean.model.IndexImg">
SELECT *
FROM tz_index_img
where `status` = 1
ORDER BY seq DESC
</select>
</mapper>
Loading…
Cancel
Save