|
@@ -22,19 +22,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="callType" column="call_type" />
|
|
<result property="callType" column="call_type" />
|
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="contentList" column="content_list" />
|
|
<result property="contentList" column="content_list" />
|
|
|
|
|
+ <result property="billingMinute" column="billing_minute" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="selectCrmCustomerCallLogList" parameterType="CrmCustomerCallLog" resultMap="CrmCustomerCallLogResult">
|
|
<select id="selectCrmCustomerCallLogList" parameterType="CrmCustomerCallLog" resultMap="CrmCustomerCallLogResult">
|
|
|
select log_id, uuid, customer_id, company_id, company_user_id, caller_num, callee_num,
|
|
select log_id, uuid, customer_id, company_id, company_user_id, caller_num, callee_num,
|
|
|
call_create_time, call_answer_time, call_time, record_path, status, intention,
|
|
call_create_time, call_answer_time, call_time, record_path, status, intention,
|
|
|
- cost, call_type, create_time, content_list
|
|
|
|
|
|
|
+ cost, call_type, create_time, content_list, billing_minute
|
|
|
from crm_customer_call_log
|
|
from crm_customer_call_log
|
|
|
<where>
|
|
<where>
|
|
|
<if test="customerId != null">AND customer_id = #{customerId}</if>
|
|
<if test="customerId != null">AND customer_id = #{customerId}</if>
|
|
|
<if test="companyId != null">AND company_id = #{companyId}</if>
|
|
<if test="companyId != null">AND company_id = #{companyId}</if>
|
|
|
<if test="companyUserId != null">AND company_user_id = #{companyUserId}</if>
|
|
<if test="companyUserId != null">AND company_user_id = #{companyUserId}</if>
|
|
|
<if test="status != null">AND status = #{status}</if>
|
|
<if test="status != null">AND status = #{status}</if>
|
|
|
- <if test="minCallTime != null">AND call_time > #{minCallTime}</if>
|
|
|
|
|
|
|
+ <if test="minCallTime != null">AND CEILING(call_time/1000) >= #{minCallTime}</if>
|
|
|
|
|
+ <if test="maxCallTime != null">AND CEILING(call_time/1000) <= #{maxCallTime}</if>
|
|
|
|
|
+ <if test="callerNum != null and callerNum != ''">AND (caller_num = #{callerNum} OR caller_num = #{plainCallerNum})</if>
|
|
|
|
|
+ <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
+ AND date_format(create_time,'%Y-%m-%d') >= #{beginTime}
|
|
|
|
|
+ AND date_format(create_time,'%Y-%m-%d') <= #{endTime}
|
|
|
|
|
+ </if>
|
|
|
</where>
|
|
</where>
|
|
|
order by create_time desc
|
|
order by create_time desc
|
|
|
</select>
|
|
</select>
|
|
@@ -67,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="callType != null">call_type,</if>
|
|
<if test="callType != null">call_type,</if>
|
|
|
|
|
+ <if test="billingMinute != null">billing_minute,</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="runTime != null">#{runTime},</if>
|
|
<if test="runTime != null">#{runTime},</if>
|
|
@@ -91,8 +99,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="callType != null">#{callType},</if>
|
|
<if test="callType != null">#{callType},</if>
|
|
|
|
|
+ <if test="billingMinute != null">#{billingMinute},</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
+ <select id="selectSumBillingMinute" parameterType="CrmCustomerCallLog" resultType="java.lang.Long">
|
|
|
|
|
+ select IFNULL(SUM(billing_minute), 0)
|
|
|
|
|
+ from crm_customer_call_log
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="customerId != null">AND customer_id = #{customerId}</if>
|
|
|
|
|
+ <if test="companyId != null">AND company_id = #{companyId}</if>
|
|
|
|
|
+ <if test="companyUserId != null">AND company_user_id = #{companyUserId}</if>
|
|
|
|
|
+ <if test="status != null">AND status = #{status}</if>
|
|
|
|
|
+ <if test="minCallTime != null">AND CEILING(call_time/1000) >= #{minCallTime}</if>
|
|
|
|
|
+ <if test="maxCallTime != null">AND CEILING(call_time/1000) <= #{maxCallTime}</if>
|
|
|
|
|
+ <if test="callerNum != null and callerNum != ''">AND (caller_num = #{callerNum} OR caller_num = #{plainCallerNum})</if>
|
|
|
|
|
+ <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
|
|
|
|
+ AND date_format(create_time,'%Y-%m-%d') >= #{beginTime}
|
|
|
|
|
+ AND date_format(create_time,'%Y-%m-%d') <= #{endTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|