From 554de444b87aab5f93cb1593a8095612cf9479a7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 09 六月 2020 17:34:30 +0800
Subject: [PATCH] 订单

---
 fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackConfigMapper.xml |  133 ++++++++++++++++++++++++--------------------
 1 files changed, 72 insertions(+), 61 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackConfigMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackConfigMapper.xml
index 8283957..47f685c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackConfigMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/redpack/RedPackConfigMapper.xml
@@ -1,61 +1,72 @@
-<?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.yeshi.fanli.dao.mybatis.redpack.RedPackConfigMapper">
-  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.redpack.RedPackConfig">
-    <id column="rpc_id" property="id" jdbcType="BIGINT"/>
-    <result column="rpc_name" property="name" jdbcType="VARCHAR"/>
-    <result column="rpc_key" property="key" jdbcType="VARCHAR"/>
-    <result column="rpc_value" property="value" jdbcType="VARCHAR"/>
-    <result column="rpc_remark" property="remark" jdbcType="VARCHAR"/>
-    <result column="rpc_start_time" property="startTime" jdbcType="TIMESTAMP"/>
-    <result column="rpc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
-    <result column="rpc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
-  </resultMap>
-  <sql id="Base_Column_List">rpc_id,rpc_name,rpc_key,rpc_value,rpc_remark,rpc_start_time,rpc_create_time,rpc_update_time</sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
-    <include refid="Base_Column_List"/>from yeshi_ec_red_pack_config where rpc_id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_red_pack_config where rpc_id = #{id,jdbcType=BIGINT}</delete>
-  <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_config (rpc_id,rpc_name,rpc_key,rpc_value,rpc_remark,rpc_start_time,rpc_create_time,rpc_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
-  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_config
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">rpc_id,</if>
-      <if test="name != null">rpc_name,</if>
-      <if test="key != null">rpc_key,</if>
-      <if test="value != null">rpc_value,</if>
-      <if test="remark != null">rpc_remark,</if>
-      <if test="startTime != null">rpc_start_time,</if>
-      <if test="createTime != null">rpc_create_time,</if>
-      <if test="updateTime != null">rpc_update_time,</if>
-    </trim>values
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">#{id,jdbcType=BIGINT},</if>
-      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
-      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
-      <if test="value != null">#{value,jdbcType=VARCHAR},</if>
-      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
-      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
-      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
-      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig">update yeshi_ec_red_pack_config set rpc_name = #{name,jdbcType=VARCHAR},rpc_key = #{key,jdbcType=VARCHAR},rpc_value = #{value,jdbcType=VARCHAR},rpc_remark = #{remark,jdbcType=VARCHAR},rpc_start_time = #{startTime,jdbcType=TIMESTAMP},rpc_create_time = #{createTime,jdbcType=TIMESTAMP},rpc_update_time = #{updateTime,jdbcType=TIMESTAMP} where rpc_id = #{id,jdbcType=BIGINT}</update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig">update yeshi_ec_red_pack_config
-    <set>
-      <if test="name != null">rpc_name=#{name,jdbcType=VARCHAR},</if>
-      <if test="key != null">rpc_key=#{key,jdbcType=VARCHAR},</if>
-      <if test="value != null">rpc_value=#{value,jdbcType=VARCHAR},</if>
-      <if test="remark != null">rpc_remark=#{remark,jdbcType=VARCHAR},</if>
-      <if test="startTime != null">rpc_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
-      <if test="createTime != null">rpc_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
-      <if test="updateTime != null">rpc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
-    </set> where rpc_id = #{id,jdbcType=BIGINT}
-  </update>
-  
-  <select id="getByKey" resultMap="BaseResultMap">
-  	SELECT * FROM yeshi_ec_red_pack_config t 
-  	WHERE t.`rpc_key` = #{key} and #{startTime} >= rpc_start_time 
-  	ORDER BY rpc_start_time DESC LIMIT 1
-  </select>
-</mapper>
+<?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.yeshi.fanli.dao.mybatis.redpack.RedPackConfigMapper">
+  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.redpack.RedPackConfig">
+    <id column="rpc_id" property="id" jdbcType="BIGINT"/>
+    <result column="rpc_name" property="name" jdbcType="VARCHAR"/>
+    <result column="rpc_key" property="key" jdbcType="VARCHAR"/>
+    <result column="rpc_value" property="value" jdbcType="VARCHAR"/>
+    <result column="rpc_remark" property="remark" jdbcType="VARCHAR"/>
+    <result column="rpc_start_time" property="startTime" jdbcType="TIMESTAMP"/>
+    <result column="rpc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
+    <result column="rpc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
+  </resultMap>
+  <sql id="Base_Column_List">rpc_id,rpc_name,rpc_key,rpc_value,rpc_remark,rpc_start_time,rpc_create_time,rpc_update_time</sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
+    <include refid="Base_Column_List"/>from yeshi_ec_red_pack_config where rpc_id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_red_pack_config where rpc_id = #{id,jdbcType=BIGINT}</delete>
+  <insert id="insert" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_config (rpc_id,rpc_name,rpc_key,rpc_value,rpc_remark,rpc_start_time,rpc_create_time,rpc_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
+  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_red_pack_config
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">rpc_id,</if>
+      <if test="name != null">rpc_name,</if>
+      <if test="key != null">rpc_key,</if>
+      <if test="value != null">rpc_value,</if>
+      <if test="remark != null">rpc_remark,</if>
+      <if test="startTime != null">rpc_start_time,</if>
+      <if test="createTime != null">rpc_create_time,</if>
+      <if test="updateTime != null">rpc_update_time,</if>
+    </trim>values
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">#{id,jdbcType=BIGINT},</if>
+      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
+      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
+      <if test="value != null">#{value,jdbcType=VARCHAR},</if>
+      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
+      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
+      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig">update yeshi_ec_red_pack_config set rpc_name = #{name,jdbcType=VARCHAR},rpc_key = #{key,jdbcType=VARCHAR},rpc_value = #{value,jdbcType=VARCHAR},rpc_remark = #{remark,jdbcType=VARCHAR},rpc_start_time = #{startTime,jdbcType=TIMESTAMP},rpc_create_time = #{createTime,jdbcType=TIMESTAMP},rpc_update_time = #{updateTime,jdbcType=TIMESTAMP} where rpc_id = #{id,jdbcType=BIGINT}</update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.redpack.RedPackConfig">update yeshi_ec_red_pack_config
+    <set>
+      <if test="name != null">rpc_name=#{name,jdbcType=VARCHAR},</if>
+      <if test="key != null">rpc_key=#{key,jdbcType=VARCHAR},</if>
+      <if test="value != null">rpc_value=#{value,jdbcType=VARCHAR},</if>
+      <if test="remark != null">rpc_remark=#{remark,jdbcType=VARCHAR},</if>
+      <if test="startTime != null">rpc_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
+      <if test="createTime != null">rpc_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
+      <if test="updateTime != null">rpc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
+    </set> where rpc_id = #{id,jdbcType=BIGINT}
+  </update>
+  
+  <select id="getByKey" resultMap="BaseResultMap">
+  	SELECT * FROM yeshi_ec_red_pack_config t 
+  	WHERE t.`rpc_key` = #{key} and #{startTime} >= rpc_start_time 
+  	ORDER BY rpc_start_time DESC LIMIT 1
+  </select>
+  
+  <select id="query" resultMap="BaseResultMap">
+	SELECT * FROM `yeshi_ec_red_pack_config` t
+	WHERE t.`rpc_name` LIKE '${key}%' OR t.`rpc_value` LIKE '${key}%'
+	LIMIT #{start},#{count}
+  </select>
+  
+  <select id="count" resultType="Long">
+  	 SELECT IFNULL(COUNT(t.rpc_id),0) FROM yeshi_ec_red_pack_config t
+     WHERE t.`rpc_name` LIKE '${key}%' OR t.`rpc_value` LIKE '${key}%'
+  </select>
+</mapper>

--
Gitblit v1.8.0