| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?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.CloudCoachPaymentProgramDao">
-
- <resultMap type="com.ym.mec.biz.dal.entity.CloudCoachPaymentProgram" id="CloudCoachPaymentProgram">
- <result column="id_" property="id" />
- <result column="name_" property="name" />
- <result column="remark_" property="remark" />
- <result column="member_num_" property="memberNum" />
- <result column="user_num_" property="userNum" />
- <result column="payment_user_num_" property="paymentUserNum" />
- <result column="period_" property="period" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
- <result column="member_rank_setting_id_" property="memberRankSettingId" />
- <result column="actual_amount_" property="actualAmount" />
- <result column="original_amount_" property="originalAmount" />
- <result column="operator_" property="operator" />
- <result column="operator_name_" property="operatorName" />
- <result column="create_time_" property="createTime" />
- <result column="update_time_" property="updateTime" />
- <result column="tenant_id_" property="tenantId" />
- </resultMap>
-
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="CloudCoachPaymentProgram" >
- SELECT * FROM cloud_coach_payment_program WHERE id_ = #{id}
- </select>
-
- <!-- 全查询 -->
- <select id="findAll" resultMap="CloudCoachPaymentProgram">
- SELECT * FROM cloud_coach_payment_program ORDER BY id_
- </select>
-
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CloudCoachPaymentProgram" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- INSERT INTO cloud_coach_payment_program (name_,remark_,member_num_,user_num_,
- payment_user_num_,period_,member_rank_setting_id_,actual_amount_,original_amount_,
- operator_,create_time_,update_time_,tenant_id_)
- VALUES(#{name},#{remark},#{memberNum},#{userNum},#{paymentUserNum},#{period,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- #{memberRankSettingId},#{actualAmount},#{originalAmount},#{operator},NOW(),NOW(),#{tenantId})
- </insert>
-
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.CloudCoachPaymentProgram">
- UPDATE cloud_coach_payment_program <set>
- <if test="operator != null">
- operator_ = #{operator},
- </if>
- <if test="memberNum != null">
- member_num_ = #{memberNum},
- </if>
- <if test="tenantId != null">
- tenant_id_ = #{tenantId},
- </if>
- <if test="paymentUserNum != null">
- payment_user_num_ = #{paymentUserNum},
- </if>
- <if test="originalAmount != null">
- original_amount_ = #{originalAmount},
- </if>
- <if test="name != null">
- name_ = #{name},
- </if>
- <if test="remark != null">
- remark_ = #{remark},
- </if>
- <if test="period != null">
- period_ = #{period,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- </if>
- <if test="userNum != null">
- user_num_ = #{userNum},
- </if>
- <if test="updateTime != null">
- update_time_ = #{updateTime},
- </if>
- <if test="memberRankSettingId != null">
- member_rank_setting_id_ = #{memberRankSettingId},
- </if>
- <if test="actualAmount != null">
- actual_amount_ = #{actualAmount},
- </if>
- </set> WHERE id_ = #{id}
- </update>
-
- <!-- 根据主键删除一条记录 -->
- <delete id="delete" >
- DELETE FROM cloud_coach_payment_program WHERE id_ = #{id}
- </delete>
- <sql id="queryPageSql">
- <where>
- <if test="tenantId != null">
- AND ccpp.tenant_id_ = #{tenantId}
- </if>
- <if test="period != null and period != ''">
- AND ccpp.period_ = #{period}
- </if>
- <if test="startTime != null and startTime != ''">
- AND DATE_FORMAT(ccpp.create_time_,"%Y-%m-%d") >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND DATE_FORMAT(ccpp.create_time_,"%Y-%m-%d") <= #{endTime}
- </if>
- </where>
- </sql>
-
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="CloudCoachPaymentProgram" parameterType="map">
- SELECT ccpp.*,su.real_name_ operator_name_ FROM cloud_coach_payment_program ccpp
- LEFT JOIN sys_user su ON su.id_ = ccpp.operator_
- <include refid="queryPageSql"/>
- ORDER BY ccpp.id_ DESC
- <include refid="global.limit"/>
- </select>
-
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(DISTINCT ccpp.id_) FROM cloud_coach_payment_program ccpp
- <include refid="queryPageSql"/>
- </select>
- </mapper>
|