Compare commits
4 Commits
main
...
xuyang_bra
Author | SHA1 | Date |
---|---|---|
|
8d273ec582 | 5 months ago |
|
9e55697190 | 5 months ago |
|
797aef41bd | 5 months ago |
|
b0d403429e | 5 months ago |
@ -1,31 +0,0 @@
|
|||||||
package com.itheima.dao;
|
|
||||||
import com.itheima.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,95 +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="com.itheima.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>
|
|
||||||
<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 com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.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,29 +0,0 @@
|
|||||||
package com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.po.DormClean;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @program: dormitorySystem
|
|
||||||
* @description: 宿舍卫生
|
|
||||||
* @author: Joyrocky
|
|
||||||
* @create: 2019-04-24 14:37
|
|
||||||
**/
|
|
||||||
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="com.itheima.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="com.itheima.po.DormClean" id="cardAndInfo2">
|
|
||||||
<id property="d_id" column="d_id"/>
|
|
||||||
<result property="d_dormbuilding" column="d_dormbuilding" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,31 +0,0 @@
|
|||||||
package com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.po.DormRepair;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @program: dormitorySystem
|
|
||||||
* @description: 维修登记
|
|
||||||
* @author: Joyrocky
|
|
||||||
* @create: 2019-04-27 17:20
|
|
||||||
**/
|
|
||||||
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="com.itheima.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="com.itheima.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 com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.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,29 +0,0 @@
|
|||||||
package com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.po.StudentClean;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @program: dormitorySystem
|
|
||||||
* @description: 学生卫生
|
|
||||||
* @author: Joyrocky
|
|
||||||
* @create: 2019-04-25 12:14
|
|
||||||
**/
|
|
||||||
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="com.itheima.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="com.itheima.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 com.itheima.dao;
|
|
||||||
import com.itheima.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,27 +0,0 @@
|
|||||||
package com.itheima.dao;
|
|
||||||
|
|
||||||
import com.itheima.po.Visitor;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @program: dormitorySystem
|
|
||||||
* @description: 访客
|
|
||||||
* @author: Joyrocky
|
|
||||||
* @create: 2019-05-14 12:57
|
|
||||||
**/
|
|
||||||
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="com.itheima.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…
Reference in new issue