|
|
@@ -7,7 +7,7 @@
|
|
|
SELECT
|
|
|
personName,
|
|
|
COALESCE(otherName, '未知对手') AS otherName,
|
|
|
- otherPhone,
|
|
|
+ COALESCE(otherPhone, '未知对手号码') AS otherPhone,
|
|
|
DATE_TRUNC('month', callDate) AS call_month
|
|
|
FROM ${query.tableName}
|
|
|
<where>
|
|
|
@@ -22,6 +22,26 @@
|
|
|
#{name}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="query.otherName != null and query.otherName != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="query.otherName == '未知对手'">
|
|
|
+ AND otherName IS NULL
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND otherName = #{query.otherName}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="query.otherPhone != null and query.otherPhone != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="query.otherPhone == '未知对手号码'">
|
|
|
+ AND otherPhone IS NULL
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND otherPhone = #{query.otherPhone}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
<if test="query.startDate != null">
|
|
|
AND callDate >= #{query.startDate}
|
|
|
</if>
|
|
|
@@ -70,8 +90,15 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</if>
|
|
|
- <if test="query.otherPhone != null">
|
|
|
- and otherPhone = #{query.otherPhone}
|
|
|
+ <if test="query.otherPhone != null and query.otherPhone != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="query.otherPhone == '未知对手号码'">
|
|
|
+ AND otherPhone IS NULL
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND otherPhone = #{query.otherPhone}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
<if test="query.startDate != null">
|
|
|
AND callDate >= #{query.startDate}
|