| <?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="edu.bjtu.groupone.backend.mapper.WorkMybatisMapper"> |
| <resultMap id="WorkResultMap" type="Work"> |
| <id property="id" column="id"/> |
| <result property="title" column="title"/> |
| <result property="description" column="description"/> |
| <result property="categoryId" column="category_id"/> |
| <result property="createTime" column="create_time"/> |
| <select id="findAll" resultMap="WorkResultMap"> |
| SELECT id, title, description, category_id, create_time |
| <select id="findByCategoryIdIn" resultMap="WorkResultMap"> |
| <if test="categoryIds != null and categoryIds.size() > 0"> |
| <foreach item="categoryId" collection="categoryIds" |
| open="(" separator="," close=")"> |
| ORDER BY create_time DESC |
| LIMIT #{pageable.pageSize} OFFSET #{pageable.offset} |