conf/dao/ClassDao.xml

(开头部分) 4KB

这里只显示每个文件的开头 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="dao.ClassDao" >

    <!--分页查询-->
    <select id="getClassList" parameterType="Class" resultType="Class">
        select *from d_class
        <where>
            <if test="c_classname!=null and c_classname!='' ">
                and  c_classname like  '%${c_classname}%'
            </if>
            <if test="c_counsellor!=null and c_counsellor!=''">
                and  c_counsellor like  '%${c_counsellor}%'
            </if>
            <if test="c_classid!=null and c_classid!=0">
                and  c_classid like  '%${c_classid}%'
            </if>
        </where>
        ORDER BY  c_id asc
        limit #{currentPage},#{pageSize}
    </select>
    <!--查询数据总数-->
    <select id="totalCount"  resultType="Integer">
        select count(c_id) from d_class
        <where>
            <if test="c_classname!=null and c_classname!='' ">
                and  c_classname like  '%${c_classname}%'
            </if>
            <if test="c_counsellor!=null and c_counsellor!=''">
                and  c_counsellor like  '%${c_counsellor}%'
            </if>
            <if test="c_classid!=null and c_classid!=0">
                and  c_classid like  '%${c_classid}%'
            </if>
          </where>
    </select>

    <!--通过id删除班级信息-->
    <delete id="deleteClass" parameterType="Integer" >
        delete from d_class where c_id=#{c_id}
    </delete>
    <!--添加班级信息-->
    <insert id="addClass" parameterType="Class" keyProperty="c_id" useGeneratedKeys="true">
        insert into d_class (c_classid,c_classname,c_counsellor)
        values(#{c_classid},#{c_classname},#{c_counsellor})
    </insert>

    <select id="findClassById"  parameterType="Integer" resultType="Class" >
        select * from d_class where c_id=#{c_id}
    </select>
    <!--修改班级信息-->
    <update id="updateClass" parameterType="Class">
        update d_class
        <set>
            <if test="c_classid!=null and c_classid!=0">
                c_classid=#{c_classid},
            </if>
            <if test="c_classname !=null and c_classname !=''">
                c_classname=#{c_classname},
后面还有 45 行代码,购买后查看完整代码

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

AI 解读 AI

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

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