From 00e32e2c7f37c50c8857f1cce4e80a82d2a75890 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 25 Nov 2021 16:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/HighCouponPackageDetailsMapper.java | 54 ++++++++++++++++++- .../HighCouponPackageDetailsSqlProvider.java | 53 ++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsMapper.java b/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsMapper.java index b839fa4f..4804bc0b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsMapper.java @@ -3,6 +3,7 @@ package com.hai.dao; import com.hai.entity.HighCouponPackageDetails; import com.hai.entity.HighCouponPackageDetailsExample; import java.util.List; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.DeleteProvider; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.InsertProvider; @@ -10,7 +11,9 @@ import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.UpdateProvider; import org.apache.ibatis.type.JdbcType; import org.springframework.stereotype.Repository; @@ -29,6 +32,12 @@ public interface HighCouponPackageDetailsMapper extends HighCouponPackageDetails @DeleteProvider(type=HighCouponPackageDetailsSqlProvider.class, method="deleteByExample") int deleteByExample(HighCouponPackageDetailsExample example); + @Delete({ + "delete from high_coupon_package_details", + "where id = #{id,jdbcType=INTEGER}" + }) + int deleteByPrimaryKey(Integer id); + @Insert({ "insert into high_coupon_package_details (coupon_package_id, coupon_id, ", "num, created_user_id, ", @@ -50,7 +59,7 @@ public interface HighCouponPackageDetailsMapper extends HighCouponPackageDetails @SelectProvider(type=HighCouponPackageDetailsSqlProvider.class, method="selectByExample") @Results({ - @Result(column="id", property="id", jdbcType=JdbcType.INTEGER), + @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), @Result(column="coupon_package_id", property="couponPackageId", jdbcType=JdbcType.INTEGER), @Result(column="coupon_id", property="couponId", jdbcType=JdbcType.INTEGER), @Result(column="num", property="num", jdbcType=JdbcType.INTEGER), @@ -65,9 +74,52 @@ public interface HighCouponPackageDetailsMapper extends HighCouponPackageDetails }) List selectByExample(HighCouponPackageDetailsExample example); + @Select({ + "select", + "id, coupon_package_id, coupon_id, num, created_user_id, created_time, updated_user_id, ", + "updated_time, `status`, ext_1, ext_2, ext_3", + "from high_coupon_package_details", + "where id = #{id,jdbcType=INTEGER}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), + @Result(column="coupon_package_id", property="couponPackageId", jdbcType=JdbcType.INTEGER), + @Result(column="coupon_id", property="couponId", jdbcType=JdbcType.INTEGER), + @Result(column="num", property="num", jdbcType=JdbcType.INTEGER), + @Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER), + @Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER), + @Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighCouponPackageDetails selectByPrimaryKey(Integer id); + @UpdateProvider(type=HighCouponPackageDetailsSqlProvider.class, method="updateByExampleSelective") int updateByExampleSelective(@Param("record") HighCouponPackageDetails record, @Param("example") HighCouponPackageDetailsExample example); @UpdateProvider(type=HighCouponPackageDetailsSqlProvider.class, method="updateByExample") int updateByExample(@Param("record") HighCouponPackageDetails record, @Param("example") HighCouponPackageDetailsExample example); + + @UpdateProvider(type=HighCouponPackageDetailsSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighCouponPackageDetails record); + + @Update({ + "update high_coupon_package_details", + "set coupon_package_id = #{couponPackageId,jdbcType=INTEGER},", + "coupon_id = #{couponId,jdbcType=INTEGER},", + "num = #{num,jdbcType=INTEGER},", + "created_user_id = #{createdUserId,jdbcType=INTEGER},", + "created_time = #{createdTime,jdbcType=TIMESTAMP},", + "updated_user_id = #{updatedUserId,jdbcType=INTEGER},", + "updated_time = #{updatedTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=INTEGER}" + }) + int updateByPrimaryKey(HighCouponPackageDetails record); } \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsSqlProvider.java index 8a7b98d3..badc9777 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponPackageDetailsSqlProvider.java @@ -184,6 +184,59 @@ public class HighCouponPackageDetailsSqlProvider { return sql.toString(); } + public String updateByPrimaryKeySelective(HighCouponPackageDetails record) { + SQL sql = new SQL(); + sql.UPDATE("high_coupon_package_details"); + + if (record.getCouponPackageId() != null) { + sql.SET("coupon_package_id = #{couponPackageId,jdbcType=INTEGER}"); + } + + if (record.getCouponId() != null) { + sql.SET("coupon_id = #{couponId,jdbcType=INTEGER}"); + } + + if (record.getNum() != null) { + sql.SET("num = #{num,jdbcType=INTEGER}"); + } + + if (record.getCreatedUserId() != null) { + sql.SET("created_user_id = #{createdUserId,jdbcType=INTEGER}"); + } + + if (record.getCreatedTime() != null) { + sql.SET("created_time = #{createdTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdatedUserId() != null) { + sql.SET("updated_user_id = #{updatedUserId,jdbcType=INTEGER}"); + } + + if (record.getUpdatedTime() != null) { + sql.SET("updated_time = #{updatedTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=INTEGER}"); + + return sql.toString(); + } + protected void applyWhere(SQL sql, HighCouponPackageDetailsExample example, boolean includeExamplePhrase) { if (example == null) { return;