|
|
@@ -27,12 +27,13 @@
|
|
|
<result column="follow_explain" jdbcType="VARCHAR" property="followExplain" />
|
|
|
<result column="follow_aname" jdbcType="VARCHAR" property="followAname" />
|
|
|
<result column="follow_aid" jdbcType="VARCHAR" property="followAid" />
|
|
|
+ <result column="aname" jdbcType="VARCHAR" property="aname" />
|
|
|
</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, sign_number, sign_amount, last_signing_time,
|
|
|
- first_signing_time, follow_dep, follow_explain, follow_aname, follow_aid
|
|
|
+ first_signing_time, follow_dep, follow_explain, follow_aname, follow_aid, aname
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -44,32 +45,29 @@
|
|
|
delete from user_mid
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.UserMid">
|
|
|
- insert into user_mid (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, sign_number,
|
|
|
- sign_amount, last_signing_time, first_signing_time,
|
|
|
- follow_dep, follow_explain, follow_aname,
|
|
|
- follow_aid)
|
|
|
- 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}, #{signNumber,jdbcType=INTEGER},
|
|
|
- #{signAmount,jdbcType=DECIMAL}, #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE},
|
|
|
- #{followDep,jdbcType=VARCHAR}, #{followExplain,jdbcType=VARCHAR}, #{followAname,jdbcType=VARCHAR},
|
|
|
- #{followAid,jdbcType=VARCHAR})
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserMid" useGeneratedKeys="true">
|
|
|
+ insert into user_mid (`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, sign_number, sign_amount,
|
|
|
+ last_signing_time, first_signing_time, follow_dep,
|
|
|
+ follow_explain, follow_aname, follow_aid,
|
|
|
+ aname)
|
|
|
+ values (#{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}, #{signNumber,jdbcType=INTEGER}, #{signAmount,jdbcType=DECIMAL},
|
|
|
+ #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE}, #{followDep,jdbcType=VARCHAR},
|
|
|
+ #{followExplain,jdbcType=VARCHAR}, #{followAname,jdbcType=VARCHAR}, #{followAid,jdbcType=VARCHAR},
|
|
|
+ #{aname,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserMid" useGeneratedKeys="true">
|
|
|
insert into user_mid
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
<if test="uid != null">
|
|
|
`uid`,
|
|
|
</if>
|
|
|
@@ -142,11 +140,11 @@
|
|
|
<if test="followAid != null">
|
|
|
follow_aid,
|
|
|
</if>
|
|
|
+ <if test="aname != null">
|
|
|
+ aname,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
<if test="uid != null">
|
|
|
#{uid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -219,6 +217,9 @@
|
|
|
<if test="followAid != null">
|
|
|
#{followAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="aname != null">
|
|
|
+ #{aname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
|
|
|
@@ -296,6 +297,9 @@
|
|
|
<if test="followAid != null">
|
|
|
follow_aid = #{followAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="aname != null">
|
|
|
+ aname = #{aname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -324,10 +328,12 @@
|
|
|
follow_dep = #{followDep,jdbcType=VARCHAR},
|
|
|
follow_explain = #{followExplain,jdbcType=VARCHAR},
|
|
|
follow_aname = #{followAname,jdbcType=VARCHAR},
|
|
|
- follow_aid = #{followAid,jdbcType=VARCHAR}
|
|
|
+ follow_aid = #{followAid,jdbcType=VARCHAR},
|
|
|
+ aname = #{aname,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
+
|
|
|
<update id="updateByUid" parameterType="com.goafanti.common.model.UserMid">
|
|
|
update user_mid
|
|
|
<set>
|
|
|
@@ -400,6 +406,9 @@
|
|
|
<if test="followAid != null">
|
|
|
follow_aid = #{followAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="aname != null">
|
|
|
+ aname = #{aname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where `uid` = #{uid,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -441,7 +450,7 @@
|
|
|
|
|
|
<select id="getUserTaskNames" resultType="java.lang.String">
|
|
|
select group_concat(distinct b.commodity_name)task_names from t_order_new a
|
|
|
- left join t_order_task b on a.order_no =b.order_no
|
|
|
+ left join t_order_task b on a.order_no =b.order_no
|
|
|
where a.buyer_id = #{uid}
|
|
|
group by a.buyer_id
|
|
|
</select>
|
|
|
@@ -450,7 +459,7 @@
|
|
|
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}
|
|
|
+ and a.buyer_id= #{uid}
|
|
|
group by a.buyer_id
|
|
|
</select>
|
|
|
|
|
|
@@ -465,9 +474,9 @@
|
|
|
from user a left join user_mid b on a.id=b.uid left join admin c on a.aid=c.id
|
|
|
left join department d on c.department_id =d.id
|
|
|
where a.share_type =2
|
|
|
- <if test="userName != null">
|
|
|
- and a.nickname like concat('%',#{userName},'%')
|
|
|
- </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ and a.nickname like concat('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
<if test="aid != null">
|
|
|
and c.id =#{aid}
|
|
|
</if>
|
|
|
@@ -634,12 +643,12 @@
|
|
|
|
|
|
<select id="selectsignStatisticsOrderList" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.delete_sign deleteSign,
|
|
|
- a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
|
|
|
- a.order_status as orderStatus, a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,c.project_type projectType,
|
|
|
- dep.name as depName,c.finance_name as financeName,c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount,
|
|
|
- a.sales_type salesType, a.channel_id channelId ,a.other
|
|
|
+ a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
|
|
|
+ a.order_status as orderStatus, a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,c.project_type projectType,
|
|
|
+ dep.name as depName,c.finance_name as financeName,c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount,
|
|
|
+ a.sales_type salesType, a.channel_id channelId ,a.other
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
|
|
|
- left join department dep on a.order_dep=dep.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
where a.process_status >4 and b.share_type =2 and a.delete_sign in(0,2)
|
|
|
<if test="amountType != null">
|
|
|
<if test="amountType == 1">
|