parent
1ab0d04ee1
commit
6be73c113f
@ -0,0 +1,44 @@
|
|||||||
|
<?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