src/main/resources/mapper/StudentDao.xml
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?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="cn.lemon.lib.mapper.StudentMapper">
<resultMap id="BaseResultMap" type="cn.lemon.lib.entity.Student">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="grade_id" jdbcType="INTEGER" property="gradeId" />
<result column="sex" jdbcType="CHAR" property="sex" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="name" jdbcType="INTEGER" property="gradeName" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
id, username, `password`, grade_id, sex, age, `status`
</sql>
<select id="getStudentListPage" resultMap="BaseResultMap">
select student.id,username,password,grade_id,sex,age,status,grade.name
from student,grade
WHERE student.grade_id = grade.id
group by student.id
LIMIT #{page},#{limit};
</select>
<select id="countOfGrade" resultType="java.lang.Long">
select IFNULL(count(id), 0)
from student
where grade_id = #{gradeId}
</select>
<select id="getStudentListOfGrade" resultMap="BaseResultMap">
select e.id,username,password,grade_id,sex,age,status,d.name
from student e LEFT JOIN grade d ON e.grade_id = d.id
where grade_id = #{gradeId}
group by e.id
LIMIT #{page},#{limit};
</select>
<select id="findByUsernameAndPassword" resultMap="BaseResultMap">
select student.id,username,password,grade_id,sex,age,status
from student
where username = #{username} and password = #{password}
</select>
<!--<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">-->
<!--delete from student-->
<!--where id = #{id,jdbcType=INTEGER}-->
<!--</delete>-->
<!--<insert id="insert" keyColumn="id" keyProperty="id" parameterType="cn.lemon.lib.vo.Student" useGeneratedKeys="true">-->
<!--insert into student (username, `password`, grade_id, -->
<!--sex, age, `status`)-->
<!--values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{gradeId,jdbcType=INTEGER}, -->
<!--#{sex,jdbcType=CHAR}, #{age,jdbcType=INTEGER}, #{status,jdbcType=INTEGER})-->
<!--</insert>-->
<!--<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="cn.lemon.lib.vo.Student" useGeneratedKeys="true">-->
<!--insert into student-->
<!--<trim prefix="(" suffix=")" suffixOverrides=",">-->
<!--<if test="username != null">-->
<!--username,-->
<!--</if>-->
<!--<if test="password != null">-->
后面还有 71 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。