|
|
@@ -91,6 +91,55 @@
|
|
|
order by filing_time desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectImportFsCompanyCustomerList" parameterType="com.fs.qw.domain.FsCompanyCustomer"
|
|
|
+ resultMap="FsCompanyCustomerResult">
|
|
|
+ <include refid="selectFsCompanyCustomerVo"/>
|
|
|
+ where del_flag = '0' and import_member_id is not null
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
+ and customer_name like concat('%', #{customerName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
+ and phone like concat('%', #{phone}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="companyUserName != null and companyUserName != ''">
|
|
|
+ and company_user_name like concat('%', #{companyUserName}, '%')
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ <if test="completeStatus != null">
|
|
|
+ and complete_status = #{completeStatus}
|
|
|
+ </if>
|
|
|
+ order by filing_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectFsCompanyCustomerById" parameterType="Long" resultMap="FsCompanyCustomerResult">
|
|
|
<include refid="selectFsCompanyCustomerVo"/>
|
|
|
where id = #{id} and del_flag = '0'
|
|
|
@@ -179,24 +228,14 @@
|
|
|
<!-- 批量新增-->
|
|
|
<insert id="insertBatchFsCompanyCustomer" parameterType="list">
|
|
|
INSERT IGNORE INTO fs_company_customer (
|
|
|
- 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, remark,
|
|
|
- import_member_id, buy_count, claim_status,
|
|
|
- complete_status, dept_id, dept_name,
|
|
|
- create_time
|
|
|
+ customer_name, phone, address, create_time,
|
|
|
+ import_member_id, present_illness, current_medication, allergy_history, claim_status
|
|
|
) VALUES
|
|
|
<foreach collection="companyCustomers" item="item" separator=",">
|
|
|
(
|
|
|
- #{item.customerName}, #{item.sex}, #{item.age}, #{item.address},
|
|
|
- #{item.phone}, #{item.filingTime}, #{item.companyUserId},
|
|
|
- #{item.companyUserName}, #{item.appointmentTime}, #{item.doctorId},
|
|
|
- #{item.doctorName}, #{item.presentIllness}, #{item.currentMedication},
|
|
|
- #{item.allergyHistory}, #{item.createBy}, #{item.remark},
|
|
|
- #{item.importMemberId}, #{item.buyCount}, #{item.claimStatus},
|
|
|
- #{item.completeStatus}, #{item.deptId}, #{item.deptName},
|
|
|
- #{item.createTime}
|
|
|
+ #{item.customerName}, #{item.phone}, #{item.address}, #{item.createTime},
|
|
|
+ #{item.importMemberId}, #{item.presentIllness}, #{item.currentMedication},
|
|
|
+ #{item.allergyHistory}, #{item.claimStatus}
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
@@ -254,4 +293,29 @@
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateBatchFsCompanyCustomer">
|
|
|
+ UPDATE fs_company_customer
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <trim prefix="present_illness = CASE" suffix="END,">
|
|
|
+ <foreach collection="companyCustomers" item="item">
|
|
|
+ WHEN id = #{item.id} THEN #{item.presentIllness}
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="current_medication = CASE" suffix="END,">
|
|
|
+ <foreach collection="companyCustomers" item="item">
|
|
|
+ WHEN id = #{item.id} THEN #{item.currentMedication}
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="allergy_history = CASE" suffix="END,">
|
|
|
+ <foreach collection="companyCustomers" item="item">
|
|
|
+ WHEN id = #{item.id} THEN #{item.allergyHistory}
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </trim>
|
|
|
+ WHERE id IN
|
|
|
+ <foreach collection="companyCustomers" item="item" open="(" separator="," close=")">
|
|
|
+ #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|