Krishya | b0cc188 | 2025-06-09 10:54:09 +0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="com.example.myproject.mapper.SeedRatingMapper"> |
| 4 | <select id="selectHighRatingsByUserId" resultType="com.example.myproject.entity.SeedRating"> |
| 5 | SELECT * FROM seed_rating |
| 6 | WHERE user_id = #{userId} |
| 7 | AND score >= 7 |
| 8 | </select> |
| 9 | |
| 10 | <select id="selectBySeedIds" resultType="com.example.myproject.entity.SeedRating"> |
| 11 | SELECT * FROM seed_rating WHERE seed_id IN |
| 12 | <foreach collection="seedIds" item="id" open="(" separator="," close=")"> |
| 13 | #{id} |
| 14 | </foreach> |
| 15 | </select> |
| 16 | </mapper> |