cc 4 meses atrás
pai
commit
c803579bb2

+ 1 - 0
src/main/java/com/qingjian/common/model/trans/query/TransFrequencyQuery.java

@@ -24,6 +24,7 @@ public class TransFrequencyQuery extends Query {
      * 用于筛选特定交易对方的交易记录
      */
     private String otherName;
+    private String otherCardNo;
     /**
      * 交易次数阈值符号
      * 用于指定最小交易次数阈值的比较符号

+ 11 - 1
src/main/resources/mappers/trans/TransFrequencyMapper.xml

@@ -15,7 +15,7 @@
         SELECT
         personName,
         COALESCE(otherName, '未知对手') as otherName,
-        otherCardNo,
+        COALESCE(otherCardNo, '未知对手卡号') as otherCardNo,
         MIN(transDate) as startTransDate,
         MAX(transDate) as endTransDate,
         COUNT(*) AS transCount ,
@@ -38,6 +38,16 @@
                     </otherwise>
                 </choose>
             </if>
+            <if test="query.otherCardNo != null and query.otherCardNo != ''">
+                <choose>
+                    <when test="query.otherCardNo == '未知对手卡号'">
+                        AND otherCardNo IS NULL
+                    </when>
+                    <otherwise>
+                        AND otherCardNo = #{query.otherCardNo}
+                    </otherwise>
+                </choose>
+            </if>
             <if test="query.startDate != null">
                 and transDate >= #{query.startDate}
             </if>