|
@@ -0,0 +1,90 @@
|
|
|
+<?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.ReplacementInstrumentActivityDao">
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity" id="ReplacementInstrumentActivity">
|
|
|
+ <result column="id_" property="id" />
|
|
|
+ <result column="cooperation_organ_id_" property="cooperationOrganId" />
|
|
|
+ <result column="user_id_" property="userId" />
|
|
|
+ <result column="user_name_" property="userName" />
|
|
|
+ <result column="grade_" property="grade" />
|
|
|
+ <result column="classes_" property="classes" />
|
|
|
+ <result column="mobile_no_" property="mobileNo" />
|
|
|
+ <result column="subject_id_" property="subjectId" />
|
|
|
+ <result column="question_result_" property="questionResult" />
|
|
|
+ <result column="instruments_id_" property="instrumentsId" />
|
|
|
+ <result column="create_time_" property="createTime" />
|
|
|
+ <result column="update_time_" property="updateTime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="ReplacementInstrumentActivity" >
|
|
|
+ SELECT * FROM replacement_instrument_activity WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="ReplacementInstrumentActivity">
|
|
|
+ SELECT * FROM replacement_instrument_activity ORDER BY id_
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
+ INSERT INTO replacement_instrument_activity (cooperation_organ_id_,user_id_,user_name_,grade_,classes_,mobile_no_,subject_id_,question_result_,instruments_id_,create_time_,update_time_)
|
|
|
+ VALUES(#{cooperationOrganId},#{userId},#{userName},#{grade},#{classes},#{mobileNo},#{subjectId},#{questionResult},#{instrumentsId},NOW(),NOW())
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity">
|
|
|
+ UPDATE replacement_instrument_activity <set>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ user_id_ = #{userId},
|
|
|
+ </if>
|
|
|
+ <if test="cooperationOrganId != null">
|
|
|
+ cooperation_organ_id_ = #{cooperationOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ user_name_ = #{userName},
|
|
|
+ </if>
|
|
|
+ <if test="questionResult != null">
|
|
|
+ question_result_ = #{questionResult},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="instrumentsId != null">
|
|
|
+ instruments_id_ = #{instrumentsId},
|
|
|
+ </if>
|
|
|
+ <if test="mobileNo != null">
|
|
|
+ mobile_no_ = #{mobileNo},
|
|
|
+ </if>
|
|
|
+ <if test="classes != null">
|
|
|
+ classes_ = #{classes},
|
|
|
+ </if>
|
|
|
+ <if test="grade != null">
|
|
|
+ grade_ = #{grade},
|
|
|
+ </if>
|
|
|
+ </set> WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete" >
|
|
|
+ DELETE FROM replacement_instrument_activity WHERE id_ = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="ReplacementInstrumentActivity" parameterType="map">
|
|
|
+ SELECT * FROM replacement_instrument_activity ORDER BY id_ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM replacement_instrument_activity
|
|
|
+ </select>
|
|
|
+</mapper>
|