Browse Source

机构分析统计

huangzhiguo 2 years ago
parent
commit
91041613e3

+ 48 - 5
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -742,7 +742,8 @@
         WHEN c.linkManIdentity=3 THEN '运营'
         WHEN c.linkManIdentity=4 THEN '其他'
         END) AS linkManStatus,
-        (CASE WHEN c.status=91 THEN '已下线'
+        (CASE WHEN c.status = 1 THEN '待审核'
+        WHEN c.status=91 THEN '已下线'
         WHEN c.status=90 THEN '已上线'
         WHEN c.status=92 THEN '审核未通过'
         WHEN c.status=93 THEN '已确认'
@@ -779,9 +780,9 @@
         FROM cm_order co
         <where>
             co.status NOT IN (0,6,7)
-            <!--<if test="monthStartTime != null and monthStartTime != '' and monthEndTime != null and monthEndTime != ''">-->
+            <if test="monthStartTime != null and monthStartTime != '' and monthEndTime != null and monthEndTime != ''">
                 AND co.orderTime BETWEEN #{monthStartTime} AND #{monthEndTime}
-            <!--</if>-->
+            </if>
         </where>
         GROUP BY co.userid) AS orderMonth ON c.userId=orderMonth.userId
 
@@ -791,9 +792,9 @@
         FROM cm_order co
         <where>
              co.status NOT IN (0,6,7)
-            <!--<if test="yearStartTime != null and yearStartTime != '' and yearEndTime != null and yearEndTime != ''">-->
+            <if test="yearStartTime != null and yearStartTime != '' and yearEndTime != null and yearEndTime != ''">
                 AND co.orderTime BETWEEN #{yearStartTime} AND #{yearEndTime}
-            <!--</if>-->
+            </if>
         </where>
         GROUP BY co.userid) AS orderYesr ON c.userId=orderYesr.userId
 
@@ -847,6 +848,48 @@
             <if test="clubDataIntegrity != null and clubDataIntegrity != ''">
                 AND c.status = #{clubDataIntegrity}
             </if>
+            <if test="payTotalMonth != null and payTotalMonth != ''">
+                <if test="payTotalMonth==1">
+                    AND orderMonth.payTotalMonth <![CDATA[ < ]]> 10000
+                </if>
+                <if test="payTotalMonth==2">
+                    AND orderMonth.payTotalMonth BETWEEN 10000 AND 100000
+                </if>
+                <if test="payTotalMonth==3">
+                    AND orderMonth.payTotalMonth BETWEEN 100000 AND 1000000
+                </if>
+                <if test="payTotalMonth==4">
+                    AND orderMonth.payTotalMonth <![CDATA[ > ]]> 1000000
+                </if>
+            </if>
+            <if test="payTotalYear != null and payTotalYear != ''">
+                <if test="payTotalYear==1">
+                    AND orderYesr.payTotalYesr <![CDATA[ < ]]> 10000
+                </if>
+                <if test="payTotalYear==2">
+                    AND orderYesr.payTotalYesr BETWEEN 10000 AND 100000
+                </if>
+                <if test="payTotalYear==3">
+                    AND orderYesr.payTotalYesr BETWEEN 100000 AND 1000000
+                </if>
+                <if test="payTotalYear==4">
+                    AND orderYesr.payTotalYesr <![CDATA[ > ]]> 1000000
+                </if>
+            </if>
+            <if test="payTotal != null and payTotal != ''">
+                <if test="payTotal==1">
+                    AND orderTotal.payTotal <![CDATA[ < ]]> 10000
+                </if>
+                <if test="payTotal==2">
+                    AND orderTotal.payTotal BETWEEN 10000 AND 100000
+                </if>
+                <if test="payTotal==3">
+                    AND orderTotal.payTotal BETWEEN 100000 AND 1000000
+                </if>
+                <if test="payTotal==4">
+                    AND orderTotal.payTotal <![CDATA[ > ]]> 1000000
+                </if>
+            </if>
         </where>
         GROUP BY c.userID
     </select>

+ 33 - 8
src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyStatisticsList.jsp

@@ -122,7 +122,7 @@
 <%--        <span style="width: 100%; height: 0; border: #0d0d0d 1px dashed;"/><br/>--%>
         <div class="flex-wrap">
             <label class="control-label">近一个月购买额:</label>
-            <form:select path="payTotalMonth" class="input-medium">
+            <form:select id="payTotalMonth" path="payTotalMonth" class="input-medium">
                 <form:option value="" label="请选择"/>
                 <form:option value="1" label="小于1万"/>
                 <form:option value="2" label="1万至10万"/>
@@ -130,7 +130,7 @@
                 <form:option value="4" label="大于100万"/>
             </form:select>
             <label class="control-label">近一个年购买额:</label>
-            <form:select path="payTotalYear" class="input-medium">
+            <form:select id ="payTotalYear" path="payTotalYear" class="input-medium">
                 <form:option value="" label="请选择"/>
                 <form:option value="1" label="小于1万"/>
                 <form:option value="2" label="1万至10万"/>
@@ -139,14 +139,14 @@
             </form:select>
             <div class="item">
                 <label>自定义统计时间:</label>
-                <form:input path="customStartTime" type="text" maxlength="20" class="input-mini Wdate" value="${customStartTime}"
+                <form:input id="customStartTime" path="customStartTime" type="text" maxlength="20" class="input-mini Wdate" value="${customStartTime}"
                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                 -
-                <form:input path="customEndTime" type="text" maxlength="20" class="input-mini Wdate" value="${customEndTime}"
+                <form:input id="customEndTime" path="customEndTime" type="text" maxlength="20" class="input-mini Wdate" value="${customEndTime}"
                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
             </div>
             <label class="control-label">总购买额:</label>
-            <form:select path="payTotal" class="input-medium">
+            <form:select id="payTotal" path="payTotal" class="input-medium">
                 <form:option value="" label="请选择"/>
                 <form:option value="1" label="小于1万"/>
                 <form:option value="2" label="1万至10万"/>
@@ -155,7 +155,7 @@
             </form:select>
         </div>
         <div class="item">
-            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="subClick()"/>
             <input id="export" class="btn btn-primary" type="button" value="导出"/>
         </div>
 
@@ -215,7 +215,7 @@
                 <c:if test="${clubList.firstClubType != null || clubList.firstClubType != ''}">
                     ${clubList.firstClubType}
                 </c:if>
-                <c:if test="${clubList.classify != null || clubList.classify != '' || clubList.classify ne null}">
+                <c:if test="${clubList.classify ne null}">
                    - ${clubList.classify}
                 </c:if>
                 <c:if test="${clubList.firstClubType == null and clubList.firstClubType == '' and clubList.classify == null and clubList.classify == ''}">
@@ -269,7 +269,32 @@
 </table>
 <div class="pagination">${page}</div>nixuel
 <script type="text/javascript">
-
+function page(n,s) {
+    $('#pageNo').val(n);
+    $('#pageSize').val(s);
+    $('#searchForm').submit();
+    return false;
+}
+function subClick() {
+    const payTotalMonth = $('#payTotalMonth').val();
+    const payTotalYear = $('#payTotalYear').val();
+    const customStartTime = $('#customStartTime').val();
+    const customEndTime = $('#customEndTime').val();
+    const payTotal = $('#payTotal').val();
+    if ((customStartTime != null || customStartTime != '') && (customEndTime != null || customEndTime != '')) {
+        if (payTotalMonth != null || payTotalMonth != '') {
+            $.jBox.confirm("自定义统计时间不能与近一个月/近一年购买额联动查询", "提示");
+        }
+        if (payTotalYear != null || payTotalYear != '') {
+            $.jBox.confirm("自定义统计时间不能与近一个月/近一年购买额联动查询", "提示");
+        }
+        if (payTotal == null || payTotal == '') {
+            $.jBox.confirm("自定义统计时间需要与总购买额一起联动查询", "提示");
+        }
+    }
+    $('#searchForm').submit();
+    return false;
+}
 </script>
 </body>
 </html>