|
|
@@ -25,14 +25,17 @@
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
- <result property="importMemberId" column="import_member_id" />
|
|
|
+ <result property="importMemberId" column="import_member_id" />
|
|
|
+ <result property="buyCount" column="buy_count" />
|
|
|
+ <result property="claimStatus" column="claim_status" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsCompanyCustomerVo">
|
|
|
select id, customer_name, sex, age, address, phone, filing_time,
|
|
|
company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
|
|
|
present_illness, current_medication, allergy_history,
|
|
|
- create_by, create_time, update_by, update_time, remark, del_flag,import_member_id
|
|
|
+ create_by, create_time, update_by, update_time, remark, del_flag, import_member_id,
|
|
|
+ buy_count,claim_status
|
|
|
from fs_company_customer
|
|
|
</sql>
|
|
|
|
|
|
@@ -51,12 +54,33 @@
|
|
|
<if test="companyUserId != null">
|
|
|
and company_user_id = #{companyUserId}
|
|
|
</if>
|
|
|
+ <if test="claimStatus != null">
|
|
|
+ and claim_status = #{claimStatus}
|
|
|
+ </if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
and filing_time >= #{beginTime}
|
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
and filing_time <= #{endTime}
|
|
|
</if>
|
|
|
+ <!-- 创建时间(新增) -->
|
|
|
+ <if test="beginCreateTime != null and beginCreateTime != ''">
|
|
|
+ and create_time >= #{beginCreateTime}
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime != null and endCreateTime != ''">
|
|
|
+ and create_time <= #{endCreateTime}
|
|
|
+ </if>
|
|
|
+ <!-- 已购筛选 -->
|
|
|
+ <if test="purchased != null and purchased == true">
|
|
|
+ and buy_count > 0
|
|
|
+ </if>
|
|
|
+ <!-- 购买次数范围 -->
|
|
|
+ <if test="minBuyCount != null">
|
|
|
+ and buy_count >= #{minBuyCount}
|
|
|
+ </if>
|
|
|
+ <if test="maxBuyCount != null">
|
|
|
+ and buy_count <= #{maxBuyCount}
|
|
|
+ </if>
|
|
|
<if test="importMemberId != null">
|
|
|
and import_member_id = #{importMemberId}
|
|
|
</if>
|
|
|
@@ -72,7 +96,6 @@
|
|
|
<include refid="selectFsCompanyCustomerVo"/>
|
|
|
<where>
|
|
|
del_flag = '0'
|
|
|
- <!-- 销售ID集合必传,不存在或为空时不生成任何条件(调用前必须确保有值) -->
|
|
|
<if test="companyUserIds != null and companyUserIds.size() > 0">
|
|
|
and company_user_id IN
|
|
|
<foreach collection="companyUserIds" item="id" open="(" separator="," close=")">
|
|
|
@@ -111,6 +134,8 @@
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
<if test="importMemberId != null">import_member_id,</if>
|
|
|
+ <if test="buyCount != null">buy_count,</if>
|
|
|
+ <if test="claimStatus != null">claim_status,</if>
|
|
|
create_time
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
@@ -131,16 +156,18 @@
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
<if test="importMemberId != null">#{importMemberId},</if>
|
|
|
+ <if test="buyCount != null">#{buyCount},</if>
|
|
|
+ <if test="claimStatus != null">#{claimStatus},</if>
|
|
|
sysdate()
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <!-- 遇到重复电话直接忽略,继续插入下一条 -->
|
|
|
+ <!-- 批量插入,支持 buy_count,若未传入则默认 0 -->
|
|
|
<insert id="insertBatchFsCompanyCustomer">
|
|
|
- INSERT IGNORE INTO fs_company_customer (customer_name, address, phone,create_time,import_member_id)
|
|
|
+ INSERT IGNORE INTO fs_company_customer (customer_name, address, phone, create_time, import_member_id,claim_status)
|
|
|
VALUES
|
|
|
<foreach collection="companyCustomers" item="item" separator=",">
|
|
|
- (#{item.customerName}, #{item.address}, #{item.phone},#{item.createTime},#{item.importMemberId})
|
|
|
+ (#{item.customerName}, #{item.address}, #{item.phone}, #{item.createTime}, #{item.importMemberId}, #{item.claimStatus})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
@@ -163,6 +190,8 @@
|
|
|
<if test="allergyHistory != null">allergy_history = #{allergyHistory},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="importMemberId != null">import_member_id = #{importMemberId},</if>
|
|
|
+ <if test="buyCount != null">buy_count = #{buyCount},</if>
|
|
|
+ <if test="claimStatus != null">claim_status = #{claimStatus},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
update_time = sysdate()
|
|
|
</set>
|
|
|
@@ -184,7 +213,7 @@
|
|
|
update fs_company_customer
|
|
|
set company_user_id = #{targetDoctorId},
|
|
|
company_user_name = #{targetDoctorName},
|
|
|
- update_time= sysdate()
|
|
|
+ update_time = sysdate()
|
|
|
where del_flag = '0'
|
|
|
and id in
|
|
|
<foreach collection="customerIds" item="id" open="(" separator="," close=")">
|