|
@@ -1,126 +1,188 @@
|
|
|
<?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.DegreeRegistrationDao">
|
|
|
- <resultMap id="DegreeRegistration" type="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
|
- <!--@mbg.generated-->
|
|
|
- <!--@Table degree_registration-->
|
|
|
- <id column="id_" jdbcType="INTEGER" property="id" />
|
|
|
- <result column="sporadic_id_" jdbcType="INTEGER" property="sporadicId" />
|
|
|
- <result column="name_" jdbcType="VARCHAR" property="name" />
|
|
|
- <result column="gender_" jdbcType="VARCHAR" property="gender" />
|
|
|
- <result column="idcard_" jdbcType="VARCHAR" property="idcard" />
|
|
|
- <result column="city_" jdbcType="VARCHAR" property="city" />
|
|
|
- <result column="school_" jdbcType="VARCHAR" property="school" />
|
|
|
- <result column="subject_" jdbcType="VARCHAR" property="subject" />
|
|
|
- <result column="level_" jdbcType="VARCHAR" property="level" />
|
|
|
- <result column="theory_level_" jdbcType="VARCHAR" property="theoryLevel" />
|
|
|
- <result column="theory_money_" jdbcType="DECIMAL" property="theoryMoney" />
|
|
|
- <result column="mobile_" jdbcType="VARCHAR" property="mobile" />
|
|
|
- <result column="money_" jdbcType="DECIMAL" property="money" />
|
|
|
- <result column="memo_" jdbcType="VARCHAR" property="memo" />
|
|
|
- <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
- <result column="status_" jdbcType="TINYINT" property="status" />
|
|
|
- </resultMap>
|
|
|
+ <resultMap id="DegreeRegistration" type="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table degree_registration-->
|
|
|
+ <id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="sporadic_id_" jdbcType="INTEGER" property="sporadicId"/>
|
|
|
+ <result column="name_" jdbcType="VARCHAR" property="name"/>
|
|
|
+ <result column="gender_" jdbcType="VARCHAR" property="gender"/>
|
|
|
+ <result column="idcard_" jdbcType="VARCHAR" property="idcard"/>
|
|
|
+ <result column="city_" jdbcType="VARCHAR" property="city"/>
|
|
|
+ <result column="school_" jdbcType="VARCHAR" property="school"/>
|
|
|
+ <result column="subject_" jdbcType="VARCHAR" property="subject"/>
|
|
|
+ <result column="level_" jdbcType="VARCHAR" property="level"/>
|
|
|
+ <result column="theory_level_" jdbcType="VARCHAR" property="theoryLevel"/>
|
|
|
+ <result column="theory_money_" jdbcType="DECIMAL" property="theoryMoney"/>
|
|
|
+ <result column="theory_cert_" jdbcType="VARCHAR" property="theoryCert"/>
|
|
|
+ <result column="mobile_" jdbcType="VARCHAR" property="mobile"/>
|
|
|
+ <result column="money_" jdbcType="DECIMAL" property="money"/>
|
|
|
+ <result column="memo_" jdbcType="VARCHAR" property="memo"/>
|
|
|
+ <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ <result column="status_" jdbcType="TINYINT" property="status"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <select id="get" parameterType="java.lang.Integer" resultMap="DegreeRegistration">
|
|
|
- select * from degree_registration where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
+ <select id="get" parameterType="java.lang.Integer" resultMap="DegreeRegistration">
|
|
|
+ select *
|
|
|
+ from degree_registration
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
|
|
|
- <!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="DegreeRegistration">
|
|
|
- SELECT *
|
|
|
- FROM degree_registration
|
|
|
- ORDER BY id_
|
|
|
- </select>
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="DegreeRegistration">
|
|
|
+ SELECT *
|
|
|
+ FROM degree_registration
|
|
|
+ ORDER BY id_
|
|
|
+ </select>
|
|
|
|
|
|
- <!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="DegreeRegistration" parameterType="map">
|
|
|
- SELECT * FROM degree_registration ORDER BY id_ <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
+ <sql id="queryPageSql">
|
|
|
+ <where>
|
|
|
+ <if test="status != null">
|
|
|
+ AND status_= #{status}
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ AND id_ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (id_ = #{search} OR name_ LIKE CONCAT('%',#{search},'%') )
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ AND name_ = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="idcard != null">
|
|
|
+ AND idcard_ = #{idcard}
|
|
|
+ </if>
|
|
|
+ <if test="school != null">
|
|
|
+ AND school_ LIKE CONCAT('%', #{school},'%')
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ AND city_ LIKE CONCAT('%', #{city},'%')
|
|
|
+ </if>
|
|
|
+ <if test="subject != null">
|
|
|
+ AND subject_= #{subject}
|
|
|
+ </if>
|
|
|
+ <if test="subject != null">
|
|
|
+ AND subject_= #{subject}
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null">
|
|
|
+ AND mobile_= #{mobile}
|
|
|
+ </if>
|
|
|
+ <if test="level != null">
|
|
|
+ AND level_= #{level}
|
|
|
+ </if>
|
|
|
+ <if test="level != null">
|
|
|
+ AND level_= #{level}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM degree_registration
|
|
|
- </select>
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="DegreeRegistration" parameterType="map">
|
|
|
+ SELECT * FROM degree_registration
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
|
|
|
- <delete id="delete" parameterType="java.lang.Integer">
|
|
|
- delete from degree_registration
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration" useGeneratedKeys="true">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into degree_registration (sporadic_id_, name_, gender_,
|
|
|
- idcard_, city_, school_,
|
|
|
- subject_,level_, theory_level_,theory_money_, mobile_,
|
|
|
- money_, memo_, create_time_,
|
|
|
- update_time_, status_)
|
|
|
- values (#{sporadicId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
|
|
|
- #{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
|
|
|
- #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR}, #{theoryLevel,jdbcType=VARCHAR},#{theoryMoney,jdbcType=DECIMAL}, #{mobile,jdbcType=VARCHAR},
|
|
|
- #{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, #{createTime},
|
|
|
- #{updateTime}, #{status,jdbcType=TINYINT})
|
|
|
- </insert>
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update degree_registration
|
|
|
- <set>
|
|
|
- <if test="sporadicId != null">
|
|
|
- sporadic_id_ = #{sporadicId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name_ = #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="gender != null">
|
|
|
- gender_ = #{gender,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="idcard != null">
|
|
|
- idcard_ = #{idcard,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="city != null">
|
|
|
- city_ = #{city,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="school != null">
|
|
|
- school_ = #{school,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="subject != null">
|
|
|
- subject_ = #{subject,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="level != null">
|
|
|
- level_ = #{level,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="theoryLevel != null">
|
|
|
- theory_level_ = #{theoryLevel,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="theoryLevel != null">
|
|
|
- theory_money_ = #{theoryMoney,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="mobile != null">
|
|
|
- mobile_ = #{mobile,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="money != null">
|
|
|
- money_ = #{money,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="memo != null">
|
|
|
- memo_ = #{memo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time_ = #{updateTime},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- status_ = #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM degree_registration
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByMobileAndSporadicId" resultMap="DegreeRegistration">
|
|
|
- SELECT * FROM degree_registration WHERE mobile_ = #{mobile} AND sporadic_id_ = #{sporadicId} FOR UPDATE
|
|
|
- </select>
|
|
|
- <select id="getLock" resultMap="DegreeRegistration">
|
|
|
- SELECT * FROM degree_registration WHERE id_ = #{id} FOR UPDATE
|
|
|
- </select>
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer">
|
|
|
+ delete
|
|
|
+ from degree_registration
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into degree_registration (sporadic_id_, name_, gender_,
|
|
|
+ idcard_, city_, school_,
|
|
|
+ subject_,level_, theory_level_,theory_money_, theory_cert_,mobile_,
|
|
|
+ money_, memo_, create_time_,
|
|
|
+ update_time_, status_)
|
|
|
+ values (#{sporadicId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
|
|
|
+ #{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
|
|
|
+ #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR},
|
|
|
+ #{theoryLevel,jdbcType=VARCHAR},#{theoryMoney,jdbcType=DECIMAL},
|
|
|
+ #{theoryLevel,jdbcType=VARCHAR}#{mobile,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR},
|
|
|
+ #{createTime},
|
|
|
+ #{updateTime}, #{status,jdbcType=TINYINT})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update degree_registration
|
|
|
+ <set>
|
|
|
+ <if test="sporadicId != null">
|
|
|
+ sporadic_id_ = #{sporadicId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name_ = #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="gender != null">
|
|
|
+ gender_ = #{gender,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="idcard != null">
|
|
|
+ idcard_ = #{idcard,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="city != null">
|
|
|
+ city_ = #{city,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="school != null">
|
|
|
+ school_ = #{school,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="subject != null">
|
|
|
+ subject_ = #{subject,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="level != null">
|
|
|
+ level_ = #{level,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="theoryLevel != null">
|
|
|
+ theory_level_ = #{theoryLevel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="theoryLevel != null">
|
|
|
+ theory_money_ = #{theoryMoney,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="theoryLevel != null">
|
|
|
+ theory_cert_ = #{theoryCert,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null">
|
|
|
+ mobile_ = #{mobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="money != null">
|
|
|
+ money_ = #{money,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="memo != null">
|
|
|
+ memo_ = #{memo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status_ = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findByMobileAndSporadicId" resultMap="DegreeRegistration">
|
|
|
+ SELECT *
|
|
|
+ FROM degree_registration
|
|
|
+ WHERE mobile_ = #{mobile}
|
|
|
+ AND sporadic_id_ = #{sporadicId} FOR
|
|
|
+ UPDATE
|
|
|
+ </select>
|
|
|
+ <select id="getLock" resultMap="DegreeRegistration">
|
|
|
+ SELECT *
|
|
|
+ FROM degree_registration
|
|
|
+ WHERE id_ = #{id} FOR
|
|
|
+ UPDATE
|
|
|
+ </select>
|
|
|
</mapper>
|