You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.7 KiB
84 lines
2.7 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.wbq.mapper.StudentMapper">
|
|
<select id="pageQuery" parameterType="com.wbq.dto.StudentPageQueryDTO"
|
|
resultType="com.wbq.entity.Student">
|
|
select * from students
|
|
where student_id in
|
|
<foreach collection="studentIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
order by FIELD(student_id,
|
|
<foreach collection="studentIds" item="id" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
|
|
|
|
<!--<select id="getByCallCount" resultType="com.wbq.entity.Student">
|
|
select * from students
|
|
<where>
|
|
<if test="minCount != null">
|
|
and call_count >= #{minCount}
|
|
</if>
|
|
<if test="maxCount != null">
|
|
and call_count <= #{maxCount}
|
|
</if>
|
|
</where>
|
|
order by score desc
|
|
</select>-->
|
|
|
|
<!--<update id="update" parameterType="com.wbq.dto.StudentDTO">
|
|
update students
|
|
<set>
|
|
<if test="score != null">
|
|
score = #{score},
|
|
</if>
|
|
<if test="callCount != null">
|
|
call_count = #{callCount},
|
|
</if>
|
|
</set>
|
|
where student_id = #{studentId}
|
|
</update>-->
|
|
|
|
<select id="getByStudentLoginDTO" parameterType="com.wbq.dto.StudentLoginDTO" resultType="com.wbq.entity.Student">
|
|
select * from students
|
|
where student_id = #{studentId} and password = #{password}
|
|
</select>
|
|
|
|
<select id="getByStudentIds" resultType="com.wbq.entity.Student">
|
|
select * from students
|
|
where student_id in
|
|
<foreach collection="studentIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="getPasswordByStudentId" resultType="java.lang.String">
|
|
select password from students
|
|
where student_id = #{studentId}
|
|
</select>
|
|
|
|
<update id="update" parameterType="com.wbq.dto.StudentDTO">
|
|
update students
|
|
<set>
|
|
<if test="name != null">
|
|
name = #{name},
|
|
</if>
|
|
<if test="password != null">
|
|
password = #{password}
|
|
</if>
|
|
</set>
|
|
where student_id = #{studentId}
|
|
</update>
|
|
|
|
<insert id="batchInsert">
|
|
insert into rollcall.students (student_id, name, password) values
|
|
<foreach collection="list" item="studentDTO" separator=",">
|
|
(#{studentDTO.studentId}, #{studentDTO.name}, #{studentDTO.password})
|
|
</foreach>
|
|
</insert>
|
|
|
|
</mapper> |