|
|
@@ -1,431 +1,447 @@
|
|
|
-<?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.goafanti.common.dao.UserLockReleaseMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserLockRelease">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- <id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
- <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
- <result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
|
- <result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
- <result column="business_project_id" jdbcType="VARCHAR" property="businessProjectId" />
|
|
|
- <result column="status" jdbcType="INTEGER" property="status" />
|
|
|
- <result column="lock_time" jdbcType="DATE" property="lockTime" />
|
|
|
- <result column="release_time" jdbcType="DATE" property="releaseTime" />
|
|
|
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- <where>
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue">
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Update_By_Example_Where_Clause">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- <where>
|
|
|
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue">
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- id, type, uid, aid, business_project_id, status, lock_time, release_time, order_no
|
|
|
- </sql>
|
|
|
- <select id="selectByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample" resultMap="BaseResultMap">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from user_lock_release
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- <if test="orderByClause != null">
|
|
|
- order by ${orderByClause}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from user_lock_release
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- delete from user_lock_release
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- delete from user_lock_release
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- insert into user_lock_release (id, type, uid,
|
|
|
- aid, business_project_id, status,
|
|
|
- lock_time, release_time, order_no
|
|
|
- )
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR},
|
|
|
- #{aid,jdbcType=VARCHAR}, #{businessProjectId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
- #{lockTime,jdbcType=DATE}, #{releaseTime,jdbcType=DATE}, #{orderNo,jdbcType=VARCHAR}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- insert into user_lock_release
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type,
|
|
|
- </if>
|
|
|
- <if test="uid != null">
|
|
|
- uid,
|
|
|
- </if>
|
|
|
- <if test="aid != null">
|
|
|
- aid,
|
|
|
- </if>
|
|
|
- <if test="businessProjectId != null">
|
|
|
- business_project_id,
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- status,
|
|
|
- </if>
|
|
|
- <if test="lockTime != null">
|
|
|
- lock_time,
|
|
|
- </if>
|
|
|
- <if test="releaseTime != null">
|
|
|
- release_time,
|
|
|
- </if>
|
|
|
- <if test="orderNo != null">
|
|
|
- order_no,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="uid != null">
|
|
|
- #{uid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="aid != null">
|
|
|
- #{aid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="businessProjectId != null">
|
|
|
- #{businessProjectId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="lockTime != null">
|
|
|
- #{lockTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="releaseTime != null">
|
|
|
- #{releaseTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="orderNo != null">
|
|
|
- #{orderNo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <select id="countByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample" resultType="java.lang.Long">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- select count(*) from user_lock_release
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- update user_lock_release
|
|
|
- <set>
|
|
|
- <if test="record.id != null">
|
|
|
- id = #{record.id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.type != null">
|
|
|
- type = #{record.type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.uid != null">
|
|
|
- uid = #{record.uid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.aid != null">
|
|
|
- aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.businessProjectId != null">
|
|
|
- business_project_id = #{record.businessProjectId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.status != null">
|
|
|
- status = #{record.status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.lockTime != null">
|
|
|
- lock_time = #{record.lockTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="record.releaseTime != null">
|
|
|
- release_time = #{record.releaseTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="record.orderNo != null">
|
|
|
- order_no = #{record.orderNo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- update user_lock_release
|
|
|
- set id = #{record.id,jdbcType=VARCHAR},
|
|
|
- type = #{record.type,jdbcType=INTEGER},
|
|
|
- uid = #{record.uid,jdbcType=VARCHAR},
|
|
|
- aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
- business_project_id = #{record.businessProjectId,jdbcType=VARCHAR},
|
|
|
- status = #{record.status,jdbcType=INTEGER},
|
|
|
- lock_time = #{record.lockTime,jdbcType=DATE},
|
|
|
- release_time = #{record.releaseTime,jdbcType=DATE},
|
|
|
- order_no = #{record.orderNo,jdbcType=VARCHAR}
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- update user_lock_release
|
|
|
- <set>
|
|
|
- <if test="type != null">
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="uid != null">
|
|
|
- uid = #{uid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="aid != null">
|
|
|
- aid = #{aid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="businessProjectId != null">
|
|
|
- business_project_id = #{businessProjectId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- status = #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="lockTime != null">
|
|
|
- lock_time = #{lockTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="releaseTime != null">
|
|
|
- release_time = #{releaseTime,jdbcType=DATE},
|
|
|
- </if>
|
|
|
- <if test="orderNo != null">
|
|
|
- order_no = #{orderNo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
- -->
|
|
|
- update user_lock_release
|
|
|
- set type = #{type,jdbcType=INTEGER},
|
|
|
- uid = #{uid,jdbcType=VARCHAR},
|
|
|
- aid = #{aid,jdbcType=VARCHAR},
|
|
|
- business_project_id = #{businessProjectId,jdbcType=VARCHAR},
|
|
|
- status = #{status,jdbcType=INTEGER},
|
|
|
- lock_time = #{lockTime,jdbcType=DATE},
|
|
|
- release_time = #{releaseTime,jdbcType=DATE},
|
|
|
- order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <delete id="deleteLockByOrder">
|
|
|
- delete from user_lock_release where order_no = #{orderNo,jdbcType=VARCHAR} and business_project_id = #{businessProjectId,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="updateUserLock">
|
|
|
- update user_lock_release set status = #{newStatus} where uid = #{uid} and aid = #{aid} and type = 0 and status = #{oldStatus}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="updateUserTypeLock">
|
|
|
- update user_lock_release set status = #{newStatus} , release_time= #{date}
|
|
|
- where uid = #{uid} and aid = #{aid} and type = 0 and type = #{type}
|
|
|
- </update>
|
|
|
-
|
|
|
- <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- t0.id,
|
|
|
- t0.uid,
|
|
|
- t0.aid,
|
|
|
- t0.lock_time,
|
|
|
- t1.last_follow_time
|
|
|
- from
|
|
|
- (select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
- left join
|
|
|
- (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
- where datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30 or datediff(now(),t0.lock_time)>270
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWaitReleaseBusiness" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- t0.id,
|
|
|
- t0.uid,
|
|
|
- t0.aid,
|
|
|
- t0.lock_time,
|
|
|
- t1.last_follow_time
|
|
|
- from
|
|
|
- (select id,uid,aid,lock_time from user_lock_release t0 where aid = #{aid} and type = 1 and status = 0)t0
|
|
|
- left join
|
|
|
- (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.uid = t1.uid
|
|
|
- where datediff(t1.last_follow_time,lock_time)>360 or datediff(now(),t0.lock_time)>900
|
|
|
- </select>
|
|
|
-
|
|
|
- <update id="updateReleaseLock" parameterType="java.lang.String">
|
|
|
- update user_lock_release set status = 2,release_time = #{time} where status=1
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="updatePendingReleaseLock" parameterType="java.lang.String">
|
|
|
- update user_lock_release set status = 1 where id in (${lockIds})
|
|
|
- </update>
|
|
|
-
|
|
|
- <select id="selectPendinglockUserList" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select id,uid,type from user_lock_release where status=1
|
|
|
- </select>
|
|
|
-
|
|
|
- <update id="updateProject" parameterType="java.lang.String">
|
|
|
- update user_lock_release set status = 2,release_time=now()
|
|
|
- where uid= #{uid,jdbcType=VARCHAR}
|
|
|
- and aid= #{aid,jdbcType=VARCHAR}
|
|
|
- and business_project_id= #{businessProjectId,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
- <select id="checkTask" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
- from user_lock_release where type =1
|
|
|
- and status=0
|
|
|
- and uid=#{buyerId,jdbcType=VARCHAR}
|
|
|
- and business_project_id=#{commodityId,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
- <update id="updatePrivateBusinessTransfer">
|
|
|
- update user_lock_release set aid=#{inputId} where uid= #{uid} and business_project_id= #{pid} and aid= #{aid};
|
|
|
- </update>
|
|
|
-
|
|
|
- <select id="checkUserProject" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
- select
|
|
|
- id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
- from user_lock_release where type =1
|
|
|
- and status=0
|
|
|
- and uid=#{uid,jdbcType=VARCHAR}
|
|
|
- and aid=#{aid,jdbcType=VARCHAR}
|
|
|
- and business_project_id=#{pid,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
+<?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.goafanti.common.dao.UserLockReleaseMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserLockRelease">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ <id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
+ <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
+ <result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
|
+ <result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
+ <result column="business_project_id" jdbcType="VARCHAR" property="businessProjectId" />
|
|
|
+ <result column="status" jdbcType="INTEGER" property="status" />
|
|
|
+ <result column="lock_time" jdbcType="DATE" property="lockTime" />
|
|
|
+ <result column="release_time" jdbcType="DATE" property="releaseTime" />
|
|
|
+ <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ <where>
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
+ <choose>
|
|
|
+ <when test="criterion.noValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.singleValue">
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.listValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Update_By_Example_Where_Clause">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ <where>
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
+ <choose>
|
|
|
+ <when test="criterion.noValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.singleValue">
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.listValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ id, type, uid, aid, business_project_id, status, lock_time, release_time, order_no
|
|
|
+ </sql>
|
|
|
+ <select id="selectByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample" resultMap="BaseResultMap">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from user_lock_release
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from user_lock_release
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ delete from user_lock_release
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ delete from user_lock_release
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ insert into user_lock_release (id, type, uid,
|
|
|
+ aid, business_project_id, status,
|
|
|
+ lock_time, release_time, order_no
|
|
|
+ )
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR},
|
|
|
+ #{aid,jdbcType=VARCHAR}, #{businessProjectId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
+ #{lockTime,jdbcType=DATE}, #{releaseTime,jdbcType=DATE}, #{orderNo,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ insert into user_lock_release
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ uid,
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid,
|
|
|
+ </if>
|
|
|
+ <if test="businessProjectId != null">
|
|
|
+ business_project_id,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status,
|
|
|
+ </if>
|
|
|
+ <if test="lockTime != null">
|
|
|
+ lock_time,
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ release_time,
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ order_no,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="businessProjectId != null">
|
|
|
+ #{businessProjectId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="lockTime != null">
|
|
|
+ #{lockTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ #{releaseTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ #{orderNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="countByExample" parameterType="com.goafanti.common.model.UserLockReleaseExample" resultType="java.lang.Long">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ select count(*) from user_lock_release
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ update user_lock_release
|
|
|
+ <set>
|
|
|
+ <if test="record.id != null">
|
|
|
+ id = #{record.id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.type != null">
|
|
|
+ type = #{record.type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.uid != null">
|
|
|
+ uid = #{record.uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.aid != null">
|
|
|
+ aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.businessProjectId != null">
|
|
|
+ business_project_id = #{record.businessProjectId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.status != null">
|
|
|
+ status = #{record.status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.lockTime != null">
|
|
|
+ lock_time = #{record.lockTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="record.releaseTime != null">
|
|
|
+ release_time = #{record.releaseTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="record.orderNo != null">
|
|
|
+ order_no = #{record.orderNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ update user_lock_release
|
|
|
+ set id = #{record.id,jdbcType=VARCHAR},
|
|
|
+ type = #{record.type,jdbcType=INTEGER},
|
|
|
+ uid = #{record.uid,jdbcType=VARCHAR},
|
|
|
+ aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
+ business_project_id = #{record.businessProjectId,jdbcType=VARCHAR},
|
|
|
+ status = #{record.status,jdbcType=INTEGER},
|
|
|
+ lock_time = #{record.lockTime,jdbcType=DATE},
|
|
|
+ release_time = #{record.releaseTime,jdbcType=DATE},
|
|
|
+ order_no = #{record.orderNo,jdbcType=VARCHAR}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ update user_lock_release
|
|
|
+ <set>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="businessProjectId != null">
|
|
|
+ business_project_id = #{businessProjectId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="lockTime != null">
|
|
|
+ lock_time = #{lockTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ release_time = #{releaseTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ order_no = #{orderNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserLockRelease">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Mon May 07 09:56:32 CST 2018.
|
|
|
+ -->
|
|
|
+ update user_lock_release
|
|
|
+ set type = #{type,jdbcType=INTEGER},
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ business_project_id = #{businessProjectId,jdbcType=VARCHAR},
|
|
|
+ status = #{status,jdbcType=INTEGER},
|
|
|
+ lock_time = #{lockTime,jdbcType=DATE},
|
|
|
+ release_time = #{releaseTime,jdbcType=DATE},
|
|
|
+ order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <delete id="deleteLockByOrder">
|
|
|
+ delete from user_lock_release where order_no = #{orderNo,jdbcType=VARCHAR} and business_project_id = #{businessProjectId,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="updateUserLock">
|
|
|
+ update user_lock_release set status = #{newStatus} where uid = #{uid} and aid = #{aid} and type = 0 and status = #{oldStatus}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateUserTypeLock">
|
|
|
+ update user_lock_release set status = #{newStatus} , release_time= #{date}
|
|
|
+ where uid = #{uid} and aid = #{aid} and type = 0 and type = #{type}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
+ select
|
|
|
+ t0.id,
|
|
|
+ t0.uid,
|
|
|
+ t0.aid,
|
|
|
+ t0.lock_time,
|
|
|
+ t1.last_follow_time
|
|
|
+ from
|
|
|
+ (select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
+ left join
|
|
|
+ (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
+ on t0.uid = t1.uid
|
|
|
+ where datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30 or datediff(now(),t0.lock_time)>270
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWaitReleaseBusiness" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
+ select
|
|
|
+ t0.id,
|
|
|
+ t0.uid,
|
|
|
+ t0.aid,
|
|
|
+ t0.lock_time,
|
|
|
+ t1.last_follow_time
|
|
|
+ from
|
|
|
+ (select id,uid,aid,lock_time from user_lock_release t0 where aid = #{aid} and type = 1 and status = 0)t0
|
|
|
+ left join
|
|
|
+ (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
+ on t0.uid = t1.uid
|
|
|
+ where datediff(t1.last_follow_time,lock_time)>360 or datediff(now(),t0.lock_time)>900
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateReleaseLock" parameterType="java.lang.String">
|
|
|
+ update user_lock_release set status = 2,release_time = #{time} where status=1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePendingReleaseLock" parameterType="java.lang.String">
|
|
|
+ update user_lock_release set status = 1 where id in (${lockIds})
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectPendinglockUserList" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
+ select id,uid,type from user_lock_release where status=1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateProject" parameterType="java.lang.String">
|
|
|
+ update user_lock_release set status = 2,release_time=now()
|
|
|
+ where uid= #{uid,jdbcType=VARCHAR}
|
|
|
+ and aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ and business_project_id= #{businessProjectId,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <select id="checkTask" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
+ select
|
|
|
+ id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
+ from user_lock_release where type =1
|
|
|
+ and status=0
|
|
|
+ and uid=#{buyerId,jdbcType=VARCHAR}
|
|
|
+ and business_project_id=#{commodityId,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <update id="updatePrivateBusinessTransfer">
|
|
|
+ update user_lock_release set aid=#{inputId} where uid= #{uid} and business_project_id= #{pid} and aid= #{aid};
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="checkUserProject" resultType="com.goafanti.customer.bo.LockingReleaseBo">
|
|
|
+ select
|
|
|
+ id, type, uid, aid, business_project_id as businessProjectId, status
|
|
|
+ from user_lock_release where type =1
|
|
|
+ and status=0
|
|
|
+ and uid=#{uid,jdbcType=VARCHAR}
|
|
|
+ and aid=#{aid,jdbcType=VARCHAR}
|
|
|
+ and business_project_id=#{pid,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectUserDays" resultType="com.goafanti.common.bo.userDaysBo">
|
|
|
+
|
|
|
+ select
|
|
|
+ t0.uid,
|
|
|
+ t0.aid,
|
|
|
+ u.nickname name
|
|
|
+ from
|
|
|
+ (select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
|
|
|
+ left join
|
|
|
+ (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
+ on t0.uid = t1.uid
|
|
|
+ left join user u on t0.uid=u.id
|
|
|
+ where datediff(now(),if(t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))> #{x} or datediff(now(),t0.lock_time)> #{y}
|
|
|
+
|
|
|
+ </select>
|
|
|
</mapper>
|