|
@@ -0,0 +1,122 @@
|
|
|
+<?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.TenantEntryActivitesDao">
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.TenantEntryActivites"
|
|
|
+ id="TenantEntryActivites">
|
|
|
+ <result column="id_" property="id" />
|
|
|
+ <result column="name_" property="name" />
|
|
|
+ <result column="cover_img_" property="coverImg" />
|
|
|
+ <result column="detail_" property="detail" />
|
|
|
+ <result column="total_price_" property="totalPrice" />
|
|
|
+ <result column="discount_price_" property="discountPrice" />
|
|
|
+ <result column="give_minutes_" property="giveMinutes" />
|
|
|
+ <result column="start_date_" property="startDate" />
|
|
|
+ <result column="end_date_" property="endDate" />
|
|
|
+ <result column="condition_" property="condition" />
|
|
|
+ <result column="del_flag_" property="delFlag" />
|
|
|
+ <result column="create_time_" property="createTime" />
|
|
|
+ <result column="update_time_" property="updateTime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="queryCondition">
|
|
|
+ <where>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and (start_date_ >= #{startDate} and end_date_ <= #{startDate})
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ and del_flag_ = #{delFlag}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="TenantEntryActivites">
|
|
|
+ SELECT * FROM tenant_entry_activites WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="TenantEntryActivites">
|
|
|
+ SELECT * FROM
|
|
|
+ tenant_entry_activites ORDER BY id_
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TenantEntryActivites"
|
|
|
+ useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
+ <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
+ AS ID FROM DUAL </selectKey> -->
|
|
|
+ INSERT INTO tenant_entry_activites
|
|
|
+ (id_,name_,cover_img_,detail_,total_price_,discount_price_,give_minutes_,start_date_,end_date_,condition_,del_flag_,create_time_,update_time_)
|
|
|
+ VALUES(#{id},#{name},#{coverImg},#{detail},#{totalPrice},#{discountPrice},#{giveMinutes},#{startDate},#{endDate},#{condition},#{delFlag},#{createTime},#{updateTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.TenantEntryActivites">
|
|
|
+ UPDATE tenant_entry_activites
|
|
|
+ <set>
|
|
|
+ <if test="condition != null">
|
|
|
+ condition_ = #{condition},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ del_flag_ = #{delFlag},
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ start_date_ = #{startDate},
|
|
|
+ </if>
|
|
|
+ <if test="coverImg != null">
|
|
|
+ cover_img_ = #{coverImg},
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ id_ = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="giveMinutes != null">
|
|
|
+ give_minutes_ = #{giveMinutes},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name_ = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="totalPrice != null">
|
|
|
+ total_price_ = #{totalPrice},
|
|
|
+ </if>
|
|
|
+ <if test="detail != null">
|
|
|
+ detail_ = #{detail},
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ end_date_ = #{endDate},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="discountPrice != null">
|
|
|
+ discount_price_ = #{discountPrice},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE FROM tenant_entry_activites WHERE id_ = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="TenantEntryActivites"
|
|
|
+ parameterType="map">
|
|
|
+ SELECT * FROM tenant_entry_activites
|
|
|
+ <include refid="queryCondition" />
|
|
|
+ order by id_ desc
|
|
|
+ <include refid="global.limit" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM tenant_entry_activites
|
|
|
+ <include refid="queryCondition" />
|
|
|
+ order by id_ desc
|
|
|
+ </select>
|
|
|
+</mapper>
|