删除文件 src/cn/edu/hactcm/dao

css
牛菲菲 2 years ago committed by Gitee
parent 44318bfaa1
commit 9b3f9b1dc3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -1,22 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.Admin;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* DAO
*/
public interface AdminDao {
// 通过账号和密码查询管理员
public Admin findAdmin(Admin admin);
//获取总条数,进行分页查询
public Integer totalCount(@Param("a_username") String a_username, @Param("a_describe") String a_describe,@Param("a_id") Integer a_id);
//获取用户列表
public List<Admin> getAdminList(@Param("a_username") String a_username, @Param("a_describe") String a_describe,@Param("a_id") Integer a_id, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int addAdmin(Admin admin); //添加管理员信息
public int deleteAdmin(Integer a_id); //删除管理员信息
public int updateAdmin(Admin admin); //修改管理员信息
public Admin findAdminById(Integer a_id);
public List<Admin> getAll();
}

@ -1,99 +0,0 @@
<?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.edu.hactcm.dao.AdminDao" >
<!--登陆查询-->
<select id="findAdmin" parameterType="Admin" resultType="Admin">
select * from d_admin
where
<if test="a_username!=null and a_username!='' ">
a_username = #{a_username}
</if>
<if test="a_password!=null and a_password!='' ">
and a_password = #{a_password}
</if>
</select>
<!--分页查询-->
<select id="getAdminList" parameterType="Admin" resultType="Admin">
select * from d_admin
<where>
<if test="a_username!=null and a_username!='' ">
and a_username like '%${a_username}%'
</if>
<if test="a_describe!=null and a_describe!=''">
and a_describe like '%${a_describe}%'
</if>
<if test="a_id!=null and a_id!=0">
and a_id like '%${a_id}%'
</if>
</where>
ORDER BY a_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(a_id) from d_admin
<where>
<if test="a_username!=null and a_username!='' ">
and a_username like '%${a_username}%'
</if>
<if test="a_describe!=null and a_describe!=''">
and a_describe like '%${a_describe}%'
</if>
<if test="a_id!=null and a_id!=0">
and a_id like '%${a_id}%'
</if>
</where>
</select>
<!--添加管理员信息-->
<insert id="addAdmin" parameterType="Admin" keyProperty="a_id" useGeneratedKeys="true">
insert into d_admin (a_username,a_password,a_name,a_phone,a_power,a_describe)
values(#{a_username},#{a_password},#{a_name},#{a_phone},#{a_power},#{a_describe})
</insert>
<!--通过id删除管理员信息-->
<delete id="deleteAdmin" parameterType="Integer" >
delete from d_admin where a_id=#{a_id}
</delete>
<select id="findAdminById" parameterType="Integer" resultType="Admin" >
select * from d_admin where a_id=#{a_id}
</select>
<select id="getAll" resultType="Admin">
select * from d_admin;
</select>
<!--修改管理员信息-->
<update id="updateAdmin" parameterType="Admin">
update d_admin
/*
set标签①update语句使用set标签动态更新列
②set标签可以为sql语句动态的添加set关键字删除多余的逗号
*/
<set>
<if test="a_username!=null and a_username !=''">
a_username=#{a_username},
</if>
<if test="a_password !=null and a_password !=''">
a_password=#{a_password},
</if>
<if test="a_name !=null and a_name !=''">
a_name=#{a_name},
</if>
<if test="a_phone !=null and a_phone !=0">
a_phone=#{a_phone},
</if>
<if test="a_power !=null and a_power !=''">
a_power=#{a_power},
</if>
<if test="a_describe!=null and a_describe!=''">
a_describe=#{a_describe},
</if>
</set>
where a_id = #{a_id}
</update>
</mapper>

@ -1,27 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.Class;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* DAO
*/
public interface ClassDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("c_classname") String c_classname, @Param("c_classid") Integer c_classid, @Param("c_counsellor") String c_counsellor);
//获取用户列表
public List<Class> getClassList(@Param("c_classname") String c_classname, @Param("c_classid") Integer c_classid, @Param("c_counsellor") String c_counsellor, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int deleteClass(Integer c_id); //删除班级信息
public int addClass(Class ucalss); //添加班级信息
public int updateClass(Class uclass); //修改班级信息
public Class findClassById(Integer c_id);
public List<Class> findClassStudent(Class uclass);//查询班级人员信息
public List<Class> getAll();
}

@ -1,105 +0,0 @@
<?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.edu.hactcm.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},
</if>
<if test="c_counsellor !=null and c_counsellor !=''">
c_counsellor=#{c_counsellor},
</if>
</set>
where c_id = #{c_id}
</update>
<!--Mybatis使用Collection进行表关联查询关联一对多数据类型(class为一student为多)且需要有id-->
<!--Association关联一对一类型-->
<!--班级人员信息查询信息-->
<resultMap type="cn.edu.hactcm.po.Class" id="cardAndInfo2">
<id property="c_id" column="c_id"/>
<result property="c_classid" column="c_classid"/>
<result property="c_classname" column="c_classname"/>
<result property="c_counsellor" column="c_counsellor"/>
<collection property="students" ofType="cn.edu.hactcm.po.Student" javaType="ArrayList">
<id property="s_id" column="s_id"/>
<result property="s_studentid" column="s_studentid"/>
<result property="s_name" column="s_name"/>
<result property="s_sex" column="s_sex"/>
<result property="s_age" column="s_age"/>
<result property="s_phone" column="s_phone"/>
<result property="s_classid" column="s_classid"/>
<result property="s_classname" column="s_classname"/>
<result property="s_dormitoryid" column="s_dormitoryid"/>
</collection>
</resultMap>
<!--SQL选择属性与构造的resultMap属性名要一致-->
<select id="findClassStudent" parameterType="Class" resultMap="cardAndInfo2">
SELECT uclass.c_id as c_id,uclass.c_classid as c_classid,uclass.c_classname as c_classname,uclass.c_counsellor as c_counsellor,
student.s_id as s_id,student.s_studentid as s_studentid,student.s_name as s_name,student.s_sex as s_sex,student.s_age as s_age,
student.s_phone as s_phone,student.s_classid as s_classid,student.s_classname as s_classname,student.s_dormitoryid as s_dormitoryid
FROM d_class uclass join d_student student
on uclass.c_classid = student.s_classid
and uclass.c_classname = student.s_classname
where uclass.c_classid = #{c_classid}
and uclass.c_classname = #{c_classname}
</select>
<select id="getAll" resultType="Class">
select * from d_class;
</select>
</mapper>

@ -1,23 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.DormClean;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DormCleanDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding);
//获取用户列表
public List<DormClean> getDormCleanList(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int addDormClean(DormClean dormclean); //添加宿舍卫生信息
public int deleteDormClean(Integer g_id); //删除宿舍卫生信息
public int updateDormClean(DormClean dormclean); //修改宿舍卫生信息
public DormClean findDormCleanById(Integer g_id);
public List<DormClean> getAll();
}

@ -1,80 +0,0 @@
<?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.edu.hactcm.dao.DormCleanDao" >
<!--分页查询-->
<select id="getDormCleanList" parameterType="DormClean" resultType="DormClean">
select *from d_dormgrade
<where>
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY g_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(g_id) from d_dormgrade
<where>
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</select>
<!--添加宿舍卫生信息-->
<insert id="addDormClean" parameterType="DormClean" keyProperty="g_id" useGeneratedKeys="true">
insert into d_dormgrade (d_id,d_dormbuilding,d_grade,create_time,update_time)
values(#{d_id},#{d_dormbuilding},#{d_grade},now(),now())
</insert>
<!--通过id删除宿舍卫生信息-->
<delete id="deleteDormClean" parameterType="Integer" >
delete from d_dormgrade where g_id=#{g_id}
</delete>
<select id="findDormCleanById" parameterType="Integer" resultType="DormClean" >
select * from d_dormgrade where g_id=#{g_id}
</select>
<!--修改宿舍卫生信息-->
<update id="updateDormClean" parameterType="DormClean">
update d_dormgrade
<set>
<if test="d_id!=null and d_id!=0">
d_id=#{d_id},
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<if test="d_grade!=null and d_grade!=0">
d_grade=#{d_grade},
</if>
<if test="update_time != null" >
update_time = now(),
</if>
</set>
where g_id = #{g_id}
</update>
<select id="getAll" resultType="DormClean">
select * from d_dormgrade;
</select>
<!--宿舍卫生信息查询信息-->
<resultMap type="cn.edu.hactcm.po.DormClean" id="cardAndInfo2">
<id property="d_id" column="d_id"/>
<result property="d_dormbuilding" column="d_dormbuilding" />
</resultMap>
</mapper>

@ -1,25 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.DormRepair;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DormRepairDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding);
//获取用户列表
public List<DormRepair> getDormRepairList(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int addDormRepair(DormRepair dormrepair); //添加宿舍信息
public int deleteDormRepair(Integer r_id); //删除宿舍信息
public int updateDormRepair(DormRepair dormrepair); //修改宿舍信息
public DormRepair findDormRepairById(Integer r_id);
public List<DormRepair> getAll();
}

@ -1,87 +0,0 @@
<?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.edu.hactcm.dao.DormRepairDao" >
<!--分页查询-->
<select id="getDormRepairList" parameterType="DormRepair" resultType="DormRepair">
select *from d_dormrepair
<where>
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY r_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(r_id) from d_dormrepair
<where>
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</select>
<!--添加宿舍信息-->
<insert id="addDormRepair" parameterType="DormRepair" keyProperty="r_id" useGeneratedKeys="true">
insert into d_dormrepair (d_id,d_dormbuilding,r_name,reason,create_time,update_time)
values(#{d_id},#{d_dormbuilding},#{r_name},#{reason},now(),now())
</insert>
<!--通过id删除宿舍信息-->
<delete id="deleteDormRepair" parameterType="Integer" >
delete from d_dormrepair where r_id=#{r_id}
</delete>
<select id="findDormRepairById" parameterType="Integer" resultType="DormRepair" >
select * from d_dormrepair where r_id=#{r_id}
</select>
<select id="getAll" resultType="DormRepair">
select * from d_dormrepair;
</select>
<!--修改宿舍信息-->
<update id="updateDormRepair" parameterType="DormRepair">
update d_dormrepair
<set>
<if test="d_id!=null and d_id!=0">
d_id=#{d_id},
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<if test="r_name !=null and r_name !=''">
r_name=#{r_name},
</if>
<if test="reason !=null and reason !=''">
reason=#{reason},
</if>
<if test="update_time !=null ">
update_time=now(),
</if>
</set>
where r_id = #{r_id}
</update>
<!--宿舍人员信息查询信息-->
<resultMap type="cn.edu.hactcm.po.DormRepair" id="cardAndInfo2">
<id property="r_id" column="r_id"/>
<result property="d_id" column="d_id" />
<result property="d_dormbuilding" column="d_dormbuilding" />
<result property="r_name" column="r_name"/>
<result property="reason" column="reason"/>
<result property="create_time" column="create_time"/>
<result property="update_time" column="update_time"/>
</resultMap>
</mapper>

@ -1,29 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.Dormitory;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* DAO
*/
public interface DormitoryDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("a_name") String a_name, @Param("s_dormitoryid") Integer s_dormitoryid,@Param("d_dormbuilding") String d_dormbuilding);
//获取用户列表
public List<Dormitory> getDormitoryList(@Param("a_name") String a_name, @Param("s_dormitoryid") Integer s_dormitoryid, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int addDormitory(Dormitory dormitory); //添加宿舍信息
public int deleteDormitory(Integer d_id); //删除宿舍信息
public int updateDormitory(Dormitory dormitory); //修改宿舍信息
public Dormitory findDormitoryById(Integer d_id);
public List<Dormitory> findDormitoryStudent(Dormitory dormitory);//查询宿舍人员信息
public List<Dormitory> getAll();
}

@ -1,109 +0,0 @@
<?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.edu.hactcm.dao.DormitoryDao" >
<!--分页查询-->
<select id="getDormitoryList" parameterType="Dormitory" resultType="Dormitory">
select *from d_dormitoryinfo
<where>
<if test="a_name!=null and a_name!=''">
and a_name like '%${a_name}%'
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY d_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(s_dormitoryid) from d_dormitoryinfo
<where>
<if test="a_name!=null and a_name!=''">
and a_name like '%${a_name}%'
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</select>
<!--添加宿舍信息-->
<insert id="addDormitory" parameterType="Dormitory" keyProperty="d_id" useGeneratedKeys="true">
insert into d_dormitoryinfo (s_dormitoryid,d_dormbuilding,d_bedtotal,d_bed,a_name)
values(#{s_dormitoryid},#{d_dormbuilding},#{d_bedtotal},#{d_bed},#{a_name})
</insert>
<!--通过id删除宿舍信息-->
<delete id="deleteDormitory" parameterType="Integer" >
delete from d_dormitoryinfo where d_id=#{d_id}
</delete>
<select id="findDormitoryById" parameterType="Integer" resultType="Dormitory" >
select * from d_dormitoryinfo where d_id=#{d_id}
</select>
<!--修改宿舍信息-->
<update id="updateDormitory" parameterType="Dormitory">
update d_dormitoryinfo
<set>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<if test="d_bedtotal !=null and d_bedtotal !=''">
d_bedtotal=#{d_bedtotal},
</if>
<if test="d_bed !=null and d_bed !=''">
d_bed=#{d_bed},
</if>
<if test="a_name !=null and a_name !=''">
a_name=#{a_name},
</if>
</set>
where d_id = #{d_id}
</update>
<!--宿舍人员信息查询信息-->
<resultMap type="cn.edu.hactcm.po.Dormitory" id="cardAndInfo2">
<id property="d_id" column="d_id"/>
<result property="s_dormitoryid" column="s_dormitoryid" />
<result property="d_dormbuilding" column="d_dormbuilding" />
<result property="d_bedtotal" column="d_bedtotal"/>
<result property="d_bed" column="d_bed"/>
<result property="a_name" column="a_name"/>
<collection property="students" ofType="cn.edu.hactcm.po.Student" javaType="ArrayList">
<id property="s_id" column="s_id"/>
<result property="s_studentid" column="s_studentid"/>
<result property="s_name" column="s_name"/>
<result property="s_sex" column="s_sex"/>
<result property="s_age" column="s_age"/>
<result property="s_phone" column="s_phone"/>
<result property="s_classid" column="s_classid"/>
<result property="s_classname" column="s_classname"/>
<result property="s_dormitoryid" column="s_dormitoryid"/>
</collection>
</resultMap>
<select id="findDormitoryStudent" parameterType="Dormitory" resultMap="cardAndInfo2">
SELECT dormitoryinfos.*,students.*
FROM d_dormitoryinfo dormitoryinfos join d_student students
on dormitoryinfos.s_dormitoryid = students.s_dormitoryid
where dormitoryinfos.s_dormitoryid = #{s_dormitoryid}
</select>
<select id="getAll" resultType="Dormitory">
select * from d_dormitoryinfo;
</select>
</mapper>

@ -1,23 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.StudentClean;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface StudentCleanDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("s_studentid") Integer s_studentid, @Param("s_name") String s_name,@Param("s_dormitoryid") Integer s_dormitoryid);
//获取用户列表
public List<StudentClean> getStudentCleanList(@Param("s_studentid") Integer s_studentid, @Param("s_name") String s_name, @Param("s_dormitoryid") Integer s_dormitoryid, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
public int addStudentClean(StudentClean studentclean); //添加宿舍卫生信息
public int deleteStudentClean(Integer g_id); //删除宿舍卫生信息
public int updateStudentClean(StudentClean studentclean); //修改宿舍卫生信息
public StudentClean findStudentCleanById(Integer g_id);
public List<StudentClean> getAll();
}

@ -1,96 +0,0 @@
<?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.edu.hactcm.dao.StudentCleanDao" >
<!--分页查询-->
<select id="getStudentCleanList" parameterType="StudentClean" resultType="StudentClean">
select *from d_stgrade
<where>
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<if test="s_name !=null and s_name !=''">
and s_name like '%${s_name}%'
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
</where>
ORDER BY g_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(g_id) from d_stgrade
<where>
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<if test="s_name !=null and s_name !=''">
and s_name like '%${s_name}%'
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
</where>
</select>
<!--添加宿舍卫生信息-->
<insert id="addStudentClean" parameterType="StudentClean" keyProperty="g_id" useGeneratedKeys="true">
insert into d_stgrade (s_studentid,s_name,s_grade,s_classid,s_dormitoryid,create_time,update_time)
values(#{s_studentid},#{s_name},#{s_grade},#{s_classid},#{s_dormitoryid},now(),now())
</insert>
<!--通过id删除宿舍卫生信息-->
<delete id="deleteStudentClean" parameterType="Integer" >
delete from d_stgrade where g_id=#{g_id}
</delete>
<select id="findStudentCleanById" parameterType="Integer" resultType="StudentClean" >
select * from d_stgrade where g_id=#{g_id}
</select>
<select id="getAll" resultType="StudentClean">
select * from d_stgrade;
</select>
<!--修改宿舍卫生信息-->
<update id="updateStudentClean" parameterType="StudentClean">
update d_stgrade
<set>
<if test="s_studentid!=null and s_studentid!=0">
s_studentid=#{s_studentid},
</if>
<if test="s_name !=null and s_name !=''">
s_name=#{s_name},
</if>
<if test="s_grade!=null and s_grade!=0">
s_grade=#{s_grade},
</if>
<if test="s_classid!=null and s_classid!=0">
s_classid=#{s_classid},
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
<if test="update_time != null" >
update_time = now(),
</if>
</set>
where g_id = #{g_id}
</update>
<!--宿舍卫生信息查询信息-->
<resultMap type="cn.edu.hactcm.po.StudentClean" id="cardAndInfo2">
<id property="g_id" column="g_id"/>
<result property="s_studentid" column="s_studentid" />
<result property="s_name" column="s_name" />
<result property="s_grade" column="s_grade" />
<result property="s_classid" column="s_classid" />
<result property="s_dormitoryid" column="s_dormitoryid" />
</resultMap>
</mapper>

@ -1,28 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.Student;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* DAO
*/
public interface StudentDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("s_name") String s_name, @Param("s_studentid")Integer s_studentid,
@Param("s_classid")Integer s_classid,@Param("s_classname")String s_classname);
//获取用户列表
public List<Student> getStudentList(@Param("s_name") String s_name, @Param("s_studentid")Integer s_studentid,@Param("s_classid")Integer s_classid,
@Param("s_classname")String s_classname, @Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize);
public int deleteStudent(Integer s_id); //删除学生信息
public int addStudent(Student student); //添加学生信息
public int updateStudent(Student student); //修改学生信息
public Student findStudentById(Integer s_id);
public List<Student> getAll();
}

@ -1,93 +0,0 @@
<?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.edu.hactcm.dao.StudentDao" >
<!--分页查询-->
<select id="getStudentList" parameterType="Student" resultType="Student">
select *from d_student
<where>
<if test="s_name!=null and s_name!='' ">
and s_name like '%${s_name}%'
</if>
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<if test="s_classid!=null and s_classid!=0">
and s_classid like '%${s_classid}%'
</if>
<if test="s_classname!=null and s_classname!='' ">
and s_classname like '%${s_classname}%'
</if>
</where>
ORDER BY s_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(s_studentid) from d_student
<where>
<if test="s_name!=null and s_name!='' ">
and s_name like '%${s_name}%'
</if>
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<if test="s_classid!=null and s_classid!=0">
and s_classid like '%${s_classid}%'
</if>
<if test="s_classname!=null and s_classname!='' ">
and s_classname like '%${s_classname}%'
</if>
</where>
</select>
<!--通过id删除学生信息-->
<delete id="deleteStudent" parameterType="Integer" >
delete from d_student where s_id=#{s_id}
</delete>
<!--添加学生信息-->
<insert id="addStudent" parameterType="Student" keyProperty="s_id" useGeneratedKeys="true">
insert into d_student (s_studentid,s_name,s_sex,s_age,s_phone,s_classid,s_classname,s_dormitoryid)
values(#{s_studentid},#{s_name},#{s_sex},#{s_age},#{s_phone},#{s_classid},#{s_classname},#{s_dormitoryid})
</insert>
<select id="findStudentById" parameterType="Integer" resultType="Student" >
select * from d_student where s_id=#{s_id}
</select>
<!--修改学生信息-->
<update id="updateStudent" parameterType="Student">
update d_student
<set>
<if test="s_studentid!=null and s_studentid!=0">
s_studentid=#{s_studentid},
</if>
<if test="s_name !=null and s_name !=''">
s_name=#{s_name},
</if>
<if test="s_sex !=null and s_sex !=''">
s_sex=#{s_sex},
</if>
<if test="s_age !=null and s_age !=0">
s_age=#{s_age},
</if>
<if test="s_phone !=null and s_phone !=0">
s_phone=#{s_phone},
</if>
<if test="s_classid!=null and s_classid!=0">
s_classid=#{s_classid},
</if>
<if test="s_classname !=null and s_classname !=''">
s_classname=#{s_classname},
</if>
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
</set>
where s_id = #{s_id}
</update>
<select id="getAll" resultType="Student">
select * from d_student;
</select>
</mapper>

@ -1,21 +0,0 @@
package cn.edu.hactcm.dao;
import cn.edu.hactcm.po.Visitor;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VisitorDao {
/**
*
*/
//获取总条数
public Integer totalCount(@Param("v_name") String v_name, @Param("v_phone")Integer v_phone);
//获取用户列表
public List<Visitor> getVisitorList(@Param("v_name") String v_name, @Param("v_phone")Integer v_phone,@Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize);
public int addVisitor(Visitor visitor); //添加学生信息
public List<Visitor> getAll();
}

@ -1,44 +0,0 @@
<?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.edu.hactcm.dao.VisitorDao" >
<!--分页查询-->
<select id="getVisitorList" parameterType="Visitor" resultType="Visitor">
select * from d_visitor
<where>
<if test="v_name!=null and v_name!='' ">
and v_name like '%${v_name}%'
</if>
<if test="v_phone!=null and v_phone!=0">
and v_phone like '%${v_phone}%'
</if>
</where>
ORDER BY v_id asc
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
select count(v_id) from d_visitor
<where>
<if test="v_name!=null and v_name!='' ">
and v_name like '%${v_name}%'
</if>
<if test="v_phone!=null and v_phone!=0">
and v_phone like '%${v_phone}%'
</if>
</where>
</select>
<!--添加学生信息-->
<insert id="addVisitor" parameterType="Visitor" keyProperty="v_id" useGeneratedKeys="true">
insert into d_visitor (v_name,v_phone,v_dormitoryid,v_dormbuilding,create_time)
values(#{v_name},#{v_phone},#{v_dormitoryid},#{v_dormbuilding},now())
</insert>
<select id="getAll" resultType="Visitor">
select * from d_visitor;
</select>
</mapper>
Loading…
Cancel
Save