|  | @@ -0,0 +1,102 @@
 | 
	
		
			
				|  |  | +<?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.ym.mec.biz.dal.dao.StudentPreVisitDao">
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<resultMap type="com.ym.mec.biz.dal.entity.StudentPreVisit" id="StudentPreVisit">
 | 
	
		
			
				|  |  | +		<result column="id_" property="id" />
 | 
	
		
			
				|  |  | +		<result column="organ_id_" property="organId" />
 | 
	
		
			
				|  |  | +		<result column="student_id_" property="studentId" />
 | 
	
		
			
				|  |  | +		<result column="student_name" property="studentName" />
 | 
	
		
			
				|  |  | +		<result column="teacher_id_" property="teacherId" />
 | 
	
		
			
				|  |  | +		<result column="teacher_name" property="teacherName" />
 | 
	
		
			
				|  |  | +		<result column="phone" property="phone" />
 | 
	
		
			
				|  |  | +		<result column="orgName" property="orgname" />
 | 
	
		
			
				|  |  | +		<result column="tenant_id_" property="tenantId" />
 | 
	
		
			
				|  |  | +		<result column="is_visit" property="isVisit" />
 | 
	
		
			
				|  |  | +		<result column="visit_cycle" property="visitCycle" />
 | 
	
		
			
				|  |  | +	</resultMap>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  | +	<select id="get" resultMap="StudentPreVisit" >
 | 
	
		
			
				|  |  | +		SELECT * FROM student_pre_visit WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 全查询 -->
 | 
	
		
			
				|  |  | +	<select id="findAll" resultMap="StudentPreVisit">
 | 
	
		
			
				|  |  | +		SELECT * FROM student_pre_visit ORDER BY id_
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 向数据库增加一条记录 -->
 | 
	
		
			
				|  |  | +	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentPreVisit" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 | 
	
		
			
				|  |  | +		<!--
 | 
	
		
			
				|  |  | +		<selectKey resultClass="int" keyProperty="id" > 
 | 
	
		
			
				|  |  | +		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 | 
	
		
			
				|  |  | +		</selectKey>
 | 
	
		
			
				|  |  | +		-->
 | 
	
		
			
				|  |  | +		INSERT INTO student_pre_visit (id_,organ_id_,student_id_,student_name,teacher_id_,teacher_name,phone,orgName,tenant_id_,is_visit,visit_cycle) VALUES(#{id},#{organId},#{studentId},#{studentName},#{teacherId},#{teacherName},#{phone},#{orgname},#{tenantId},#{isVisit},#{visitCycle})
 | 
	
		
			
				|  |  | +	</insert>
 | 
	
		
			
				|  |  | +	<insert id="batchInsert" parameterType="java.util.ArrayList">
 | 
	
		
			
				|  |  | +		INSERT INTO student_pre_visit (id_,organ_id_,student_id_,student_name,teacher_id_,teacher_name,phone,orgName,tenant_id_,is_visit,visit_cycle) VALUES
 | 
	
		
			
				|  |  | +		<foreach collection="list" item="item" index="index" separator=",">
 | 
	
		
			
				|  |  | +			(#{item.id},#{item.organId},#{item.studentId},#{item.studentName},#{item.teacherId},#{item.teacherName},#{item.phone},#{item.orgname},#{item.tenantId},#{item.isVisit},#{item.visitCycle})
 | 
	
		
			
				|  |  | +		</foreach>
 | 
	
		
			
				|  |  | +	</insert>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  | +	<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentPreVisit">
 | 
	
		
			
				|  |  | +		UPDATE student_pre_visit <set>
 | 
	
		
			
				|  |  | +<if test="studentName != null">
 | 
	
		
			
				|  |  | +student_name = #{studentName},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="organId != null">
 | 
	
		
			
				|  |  | +organ_id_ = #{organId},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="teacherName != null">
 | 
	
		
			
				|  |  | +teacher_name = #{teacherName},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="isVisit != null">
 | 
	
		
			
				|  |  | +is_visit = #{isVisit},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="orgname != null">
 | 
	
		
			
				|  |  | +orgName = #{orgname},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="id != null">
 | 
	
		
			
				|  |  | +id_ = #{id},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="phone != null">
 | 
	
		
			
				|  |  | +phone = #{phone},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="teacherId != null">
 | 
	
		
			
				|  |  | +teacher_id_ = #{teacherId},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="tenantId != null">
 | 
	
		
			
				|  |  | +tenant_id_ = #{tenantId},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="studentId != null">
 | 
	
		
			
				|  |  | +student_id_ = #{studentId},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +<if test="visitCycle != null">
 | 
	
		
			
				|  |  | +visit_cycle = #{visitCycle},
 | 
	
		
			
				|  |  | +</if>
 | 
	
		
			
				|  |  | +</set> WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +	</update>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 根据主键删除一条记录 -->
 | 
	
		
			
				|  |  | +	<delete id="delete" >
 | 
	
		
			
				|  |  | +		DELETE FROM student_pre_visit WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +	</delete>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 分页查询 -->
 | 
	
		
			
				|  |  | +	<select id="queryPage" resultMap="StudentPreVisit" parameterType="map">
 | 
	
		
			
				|  |  | +		SELECT * FROM student_pre_visit ORDER BY id_ <include refid="global.limit"/>
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	<!-- 查询当前表的总记录数 -->
 | 
	
		
			
				|  |  | +	<select id="queryCount" resultType="int">
 | 
	
		
			
				|  |  | +		SELECT COUNT(*) FROM student_pre_visit
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +</mapper>
 |