|
|
@@ -19,11 +19,16 @@
|
|
|
<result column="last_follow_type" jdbcType="INTEGER" property="lastFollowType" />
|
|
|
<result column="follow_number" jdbcType="INTEGER" property="followNumber" />
|
|
|
<result column="task_names" jdbcType="VARCHAR" property="taskNames" />
|
|
|
+ <result column="sign_number" jdbcType="INTEGER" property="signNumber" />
|
|
|
+ <result column="sign_amount" jdbcType="DECIMAL" property="signAmount" />
|
|
|
+ <result column="last_signing_time" jdbcType="DATE" property="lastSigningTime" />
|
|
|
+ <result column="first_signing_time" jdbcType="DATE" property="firstSigningTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, `uid`, aid, last_follow_time, last_sign_time, create_time, big_customer, update_aid,
|
|
|
update_name, date_update_time, channel_type, chargeback, `member`, last_sales_type,
|
|
|
- last_follow_type, follow_number, task_names
|
|
|
+ last_follow_type, follow_number, task_names, sign_number, sign_amount, last_signing_time,
|
|
|
+ first_signing_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -31,7 +36,6 @@
|
|
|
from user_mid
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
-
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
delete from user_mid
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
@@ -42,13 +46,17 @@
|
|
|
big_customer, update_aid, update_name,
|
|
|
date_update_time, channel_type, chargeback,
|
|
|
`member`, last_sales_type, last_follow_type,
|
|
|
- follow_number, task_names)
|
|
|
+ follow_number, task_names, sign_number,
|
|
|
+ sign_amount, last_signing_time, first_signing_time
|
|
|
+ )
|
|
|
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
|
|
|
#{lastFollowTime,jdbcType=TIMESTAMP}, #{lastSignTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
#{bigCustomer,jdbcType=INTEGER}, #{updateAid,jdbcType=VARCHAR}, #{updateName,jdbcType=VARCHAR},
|
|
|
#{dateUpdateTime,jdbcType=TIMESTAMP}, #{channelType,jdbcType=INTEGER}, #{chargeback,jdbcType=INTEGER},
|
|
|
#{member,jdbcType=INTEGER}, #{lastSalesType,jdbcType=INTEGER}, #{lastFollowType,jdbcType=INTEGER},
|
|
|
- #{followNumber,jdbcType=INTEGER}, #{taskNames,jdbcType=VARCHAR})
|
|
|
+ #{followNumber,jdbcType=INTEGER}, #{taskNames,jdbcType=VARCHAR}, #{signNumber,jdbcType=INTEGER},
|
|
|
+ #{signAmount,jdbcType=DECIMAL}, #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
|
|
|
insert into user_mid
|
|
|
@@ -104,6 +112,18 @@
|
|
|
<if test="taskNames != null">
|
|
|
task_names,
|
|
|
</if>
|
|
|
+ <if test="signNumber != null">
|
|
|
+ sign_number,
|
|
|
+ </if>
|
|
|
+ <if test="signAmount != null">
|
|
|
+ sign_amount,
|
|
|
+ </if>
|
|
|
+ <if test="lastSigningTime != null">
|
|
|
+ last_signing_time,
|
|
|
+ </if>
|
|
|
+ <if test="firstSigningTime != null">
|
|
|
+ first_signing_time,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
|
@@ -157,6 +177,18 @@
|
|
|
<if test="taskNames != null">
|
|
|
#{taskNames,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="signNumber != null">
|
|
|
+ #{signNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="signAmount != null">
|
|
|
+ #{signAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lastSigningTime != null">
|
|
|
+ #{lastSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="firstSigningTime != null">
|
|
|
+ #{firstSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
|
|
|
@@ -210,6 +242,18 @@
|
|
|
<if test="taskNames != null">
|
|
|
task_names = #{taskNames,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="signNumber != null">
|
|
|
+ sign_number = #{signNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="signAmount != null">
|
|
|
+ sign_amount = #{signAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lastSigningTime != null">
|
|
|
+ last_signing_time = #{lastSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="firstSigningTime != null">
|
|
|
+ first_signing_time = #{firstSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -230,7 +274,11 @@
|
|
|
last_sales_type = #{lastSalesType,jdbcType=INTEGER},
|
|
|
last_follow_type = #{lastFollowType,jdbcType=INTEGER},
|
|
|
follow_number = #{followNumber,jdbcType=INTEGER},
|
|
|
- task_names = #{taskNames,jdbcType=VARCHAR}
|
|
|
+ task_names = #{taskNames,jdbcType=VARCHAR},
|
|
|
+ sign_number = #{signNumber,jdbcType=INTEGER},
|
|
|
+ sign_amount = #{signAmount,jdbcType=DECIMAL},
|
|
|
+ last_signing_time = #{lastSigningTime,jdbcType=DATE},
|
|
|
+ first_signing_time = #{firstSigningTime,jdbcType=DATE}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
@@ -282,6 +330,18 @@
|
|
|
<if test="taskNames != null">
|
|
|
task_names = #{taskNames,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="signNumber != null">
|
|
|
+ sign_number = #{signNumber,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="signAmount != null">
|
|
|
+ sign_amount = #{signAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lastSigningTime != null">
|
|
|
+ last_signing_time = #{lastSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
+ <if test="firstSigningTime != null">
|
|
|
+ first_signing_time = #{firstSigningTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where `uid` = #{uid,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -327,4 +387,12 @@
|
|
|
where a.buyer_id = #{uid}
|
|
|
group by a.buyer_id
|
|
|
</select>
|
|
|
+ <select id="getUserDtails" resultType="com.goafanti.common.model.UserMid">
|
|
|
+ select a.buyer_id uid,min(a.sign_time)firstSigningTime,max(a.sign_time)lastSigningTime,
|
|
|
+ sum(a.total_amount)signAmount,count(*)signNumber
|
|
|
+ from t_order_new a
|
|
|
+ where a.delete_sign in (0,2) and a.process_status >4
|
|
|
+ and a.buyer_id= #{uid}
|
|
|
+ group by a.buyer_id
|
|
|
+ </select>
|
|
|
</mapper>
|