|
@@ -1,7 +1,7 @@
|
|
|
<?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.StudentCompetitionDao">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.StudentCompetition" id="StudentCompetition">
|
|
|
<result column="id_" property="id" />
|
|
|
<result column="user_id_" property="userId" />
|
|
@@ -21,28 +21,28 @@
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="StudentCompetition" >
|
|
|
SELECT * FROM student_competition WHERE id_ = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="StudentCompetition">
|
|
|
SELECT * FROM student_competition ORDER BY id_
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCompetition" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
<!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
+ <selectKey resultClass="int" keyProperty="id" >
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
</selectKey>
|
|
|
-->
|
|
|
INSERT INTO student_competition (id_,user_id_,username_,id_card_no_,age_,gender_,grade_,subject_,chapter_,picture_url_,video_url_,score_,prize_level_,is_show_,comment_,create_time_,update_time_)
|
|
|
VALUES(#{id},#{userId},#{username},#{idCardNo},#{age},#{gender},#{grade},#{subject},#{chapter},#{pictureUrl},#{videoUrl},#{score},#{prizeLevel},#{isShow},#{comment},NOW(),NOW())
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentCompetition">
|
|
|
UPDATE student_competition <set>
|
|
@@ -97,14 +97,14 @@
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete" >
|
|
|
- DELETE FROM student_competition WHERE id_ = #{id}
|
|
|
+ DELETE FROM student_competition WHERE id_ = #{id}
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="StudentCompetition" parameterType="map">
|
|
|
SELECT * FROM student_competition ORDER BY id_ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM student_competition
|