target/classes/mybatis/mapper/StudentMapper.xml

(开头部分) 2KB

这里只显示每个文件的开头 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="com.huawei.mapper.StudentMapper">

    <resultMap id="stuBedsMap" type="com.huawei.vo.Student">
        <id property="sid" column="sid"></id>
        <result property="name" column="name"></result>
        <result property="gender" column="gender"></result>
        <result property="did" column="did"></result>

        <association property="dormitory" column="did" javaType="com.huawei.vo.Dormitory">
            <id property="did" column="did"></id>
            <result property="dName" column="dname"></result>
            <!--<result property="beds" column="beds"></result>-->
        </association>

    </resultMap>

    <select id="findAllStu" resultMap="stuBedsMap">
        SELECT s.sid,s.`name`,s.gender,s.did,d.dname
        FROM student s,dormitory d
        WHERE s.did = d.did
    </select>

    <select id="findStuById" resultType="com.huawei.vo.Student" parameterType="Integer">
        SELECT *
        FROM student
        WHERE
        sid = #{sid}
    </select>

    <select id="findLikely" resultMap="stuBedsMap" parameterType="Integer">
        SELECT s.sid,s.`name`,s.gender,s.did,d.dname
        FROM student s,dormitory d
        WHERE s.did = d.did AND s.sid like '%${sid}%'
    </select>

    <insert id="addStu" parameterType="com.huawei.vo.Student">
        INSERT INTO
        student(sid,name,gender,did)
        VALUES
        (#{sid},#{name},#{gender},#{did})
    </insert>

    <update id="updateStu" parameterType="com.huawei.vo.Student">
        UPDATE student
        SET sid = #{sid},name = #{name},gender = #{gender},did=#{did}
        WHERE sid = #{sid}
    </update>

    <delete id="delStuById" parameterType="Integer">
        DELETE FROM student
        WHERE sid = #{sid}
    </delete>

    <select id="checkLogin" resultType="String">
        SELECT mname
        FROM manager
后面还有 15 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。