保存进度!
This commit is contained in:
parent
38ec1c7d6c
commit
ada65278a1
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-07-29 22:59:09
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/RankingListMapper.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.mybatis.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public interface RankingListMapper
|
||||
{
|
||||
public void getRankdingList( HashMap<String, Object> params );
|
||||
}
|
@ -24,12 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class DepartmentArchievement
|
||||
{
|
||||
|
||||
// 以后要改
|
||||
// private static String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||
// private static String userName = "desktop_archievement_admin";
|
||||
// private static String password = "Cpic123456";
|
||||
|
||||
// mybatis配置文件路径
|
||||
private static String mybatisConfigFile = "mybatis/mybatis-config.xml";
|
||||
|
||||
@ -113,95 +107,6 @@ public class DepartmentArchievement
|
||||
return archievement;
|
||||
}
|
||||
|
||||
/**
|
||||
* 静态方法,用于根据部门代码,查询部门业绩,生成一个 DepartmentArchievement 对象。
|
||||
* @param departmentCode 部门代码
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
// public static DepartmentArchievement queryDepartmentArchievement( String departmentCode )
|
||||
// throws SQLException, ClassNotFoundException
|
||||
// {
|
||||
// Connection connection = null;
|
||||
// java.sql.CallableStatement statement = null;
|
||||
// ResultSet menusual_cursor = null;
|
||||
|
||||
// DepartmentArchievement archievement = null;
|
||||
|
||||
// String sql = "{call telsale_archievement_pkg.department_archievement(?,?,?,?,?)}";
|
||||
|
||||
// try
|
||||
// {
|
||||
// Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
||||
// connection = DriverManager.getConnection( jdbcURL, userName, password );
|
||||
// statement = connection.prepareCall( sql );
|
||||
|
||||
// statement.setString( 1, departmentCode );
|
||||
// statement.registerOutParameter( 2, java.sql.Types.VARCHAR );
|
||||
// statement.registerOutParameter( 3, java.sql.Types.VARCHAR );
|
||||
// statement.registerOutParameter( 4, java.sql.Types.INTEGER );
|
||||
// statement.registerOutParameter( 5, OracleTypes.CURSOR );
|
||||
|
||||
// statement.execute();
|
||||
|
||||
// Vector<Long> menusual_list = new Vector<Long>();
|
||||
// String attach_rate = statement.getString( 2 );
|
||||
// String renewal_rate = statement.getString( 3 );
|
||||
// long totalArchievement = statement.getInt( 4 );
|
||||
|
||||
// menusual_cursor = ((OracleCallableStatement) statement).getCursor( 5 );
|
||||
|
||||
// while ( menusual_cursor.next())
|
||||
// {
|
||||
// menusual_list.add( menusual_cursor.getLong( 2 ) );
|
||||
// }
|
||||
|
||||
// archievement = new DepartmentArchievement( departmentCode, totalArchievement,
|
||||
// menusual_list, renewal_rate, attach_rate );
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// if ( menusual_cursor != null )
|
||||
// {
|
||||
// menusual_cursor.close();
|
||||
// }
|
||||
// }
|
||||
// catch ( Exception exception )
|
||||
// {
|
||||
// exception.printStackTrace();
|
||||
// }
|
||||
|
||||
// try
|
||||
// {
|
||||
// if ( statement != null )
|
||||
// {
|
||||
// statement.close();
|
||||
// }
|
||||
// }
|
||||
// catch ( Exception exception )
|
||||
// {
|
||||
// exception.printStackTrace();
|
||||
// }
|
||||
|
||||
// try
|
||||
// {
|
||||
// if ( connection != null )
|
||||
// {
|
||||
// connection.close();
|
||||
// }
|
||||
// }
|
||||
// catch ( Exception exception )
|
||||
// {
|
||||
// exception.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
// return archievement;
|
||||
// }
|
||||
|
||||
public long getTotalArchievement()
|
||||
{
|
||||
return totalArchievement;
|
||||
|
@ -9,12 +9,15 @@
|
||||
*/
|
||||
package com.cpic.xim.utils.ranking;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Vector;
|
||||
import java.util.ArrayList;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||
import oracle.jdbc.OracleCallableStatement;
|
||||
import oracle.jdbc.OracleTypes;
|
||||
|
||||
@ -25,9 +28,12 @@ public class CallerRankingList
|
||||
private static String userName = "desktop_archievement_admin";
|
||||
private static String password = "Cpic123456";
|
||||
|
||||
// 配置文件路径
|
||||
private static String configFilePath = "mybatis/mybatis-config.xml";
|
||||
|
||||
private CallerRankingList( String departmentCode, String year, String month,
|
||||
Vector<CallerRankingItem> attachingRateRankingList,
|
||||
Vector<CallerRankingItem> renewalRateRankingList)
|
||||
ArrayList<CallerRankingItem> attachingRateRankingList,
|
||||
ArrayList<CallerRankingItem> renewalRateRankingList)
|
||||
{
|
||||
this.departmentCode = departmentCode;
|
||||
this.year = year;
|
||||
@ -36,6 +42,19 @@ public class CallerRankingList
|
||||
this.renewalRateRankingList = renewalRateRankingList;
|
||||
}
|
||||
|
||||
public static CallerRankingList getCallerRankingList2( String departmentCode, String year,
|
||||
String month ) throws IOException
|
||||
{
|
||||
CallerRankingList rankingList = null;
|
||||
|
||||
String monthRegx = "(0[1-9])|(1[0-2])";
|
||||
String yearRegx = "202[0-9]";
|
||||
|
||||
SqlSession session = MybatisUtils.getSqlSession(yearRegx);
|
||||
|
||||
return rankingList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief static方法,用于查询部门坐席排行榜
|
||||
* @param departmentCode 部门代码
|
||||
@ -58,8 +77,8 @@ public class CallerRankingList
|
||||
String monthRegx = "(0[1-9])|(1[0-2])";
|
||||
String yearRegx = "20[0-2][0-0]";
|
||||
|
||||
Vector<CallerRankingItem> attachingRateRankingList = new Vector<>();
|
||||
Vector<CallerRankingItem> renewalRateRankingList = new Vector<>();
|
||||
ArrayList<CallerRankingItem> attachingRateRankingList = new ArrayList<>();
|
||||
ArrayList<CallerRankingItem> renewalRateRankingList = new ArrayList<>();
|
||||
|
||||
int index = 1;
|
||||
|
||||
@ -81,7 +100,7 @@ public class CallerRankingList
|
||||
cur_attaching = ((OracleCallableStatement) statement).getCursor( 4 );
|
||||
index = 1;
|
||||
|
||||
while ( cur_attaching.next())
|
||||
while (cur_attaching.next())
|
||||
{
|
||||
String callerName = cur_attaching.getString( 1 );
|
||||
String appraiseValue = cur_attaching.getString( 2 );
|
||||
@ -98,7 +117,7 @@ public class CallerRankingList
|
||||
cur_renewal = ((OracleCallableStatement) statement).getCursor( 5 );
|
||||
index = 1;
|
||||
|
||||
while ( cur_renewal.next())
|
||||
while (cur_renewal.next())
|
||||
{
|
||||
String callerName = cur_renewal.getString( 1 );
|
||||
String appraiseValue = cur_renewal.getString( 2 );
|
||||
@ -153,7 +172,6 @@ public class CallerRankingList
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return rankingList;
|
||||
}
|
||||
|
||||
@ -187,22 +205,22 @@ public class CallerRankingList
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public Vector<CallerRankingItem> getAttachingRateRankingList()
|
||||
public ArrayList<CallerRankingItem> getAttachingRateRankingList()
|
||||
{
|
||||
return attachingRateRankingList;
|
||||
}
|
||||
|
||||
public void setAttachingRateRankingList( Vector<CallerRankingItem> attachingRateRankingList )
|
||||
public void setAttachingRateRankingList( ArrayList<CallerRankingItem> attachingRateRankingList )
|
||||
{
|
||||
this.attachingRateRankingList = attachingRateRankingList;
|
||||
}
|
||||
|
||||
public Vector<CallerRankingItem> getRenewalRateRankingList()
|
||||
public ArrayList<CallerRankingItem> getRenewalRateRankingList()
|
||||
{
|
||||
return renewalRateRankingList;
|
||||
}
|
||||
|
||||
public void setRenewalRateRankingList( Vector<CallerRankingItem> renewalRateRankingList )
|
||||
public void setRenewalRateRankingList( ArrayList<CallerRankingItem> renewalRateRankingList )
|
||||
{
|
||||
this.renewalRateRankingList = renewalRateRankingList;
|
||||
}
|
||||
@ -217,9 +235,9 @@ public class CallerRankingList
|
||||
private String month;
|
||||
|
||||
// 车非融合率排行
|
||||
private Vector<CallerRankingItem> attachingRateRankingList;
|
||||
private ArrayList<CallerRankingItem> attachingRateRankingList;
|
||||
|
||||
// 续保率排行
|
||||
private Vector<CallerRankingItem> renewalRateRankingList;
|
||||
private ArrayList<CallerRankingItem> renewalRateRankingList;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cpic.xim.mybatis.mapper.RankingListMapper">
|
||||
<select id="getRankdingList" statementType="CALLABLE" parameterMap="java.util.HashMap">
|
||||
call telsale_archievement_pkg.caller_arch_ranking_list(
|
||||
#{a_department_code,mode=IN,jdbcType=VARCHAR},
|
||||
#{a_year,mode=IN,jdbcType=VARCHAR},
|
||||
#{a_month,mode=IN,jdbcType=VARCHAR},
|
||||
#{a_attaching_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=AttachingRateRankingMap},
|
||||
#{a_renewal_ranking_list,mode=OUT,jdbcType=CURSOR, resultMap=RenewalRateRankingMap})
|
||||
</select>
|
||||
<resultMap id="AttachingRateRankingMap" type="CallerRankingItem">
|
||||
<id property="index" column="rownum" jdbcType="Integer" javaType="int"/>
|
||||
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||
<result property="appraiseValue" column="attaching_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||
</resultMap>
|
||||
<resultMap id="RenewalRateRankingMap" type="CallerRankingItem">
|
||||
<id property="index" column="rownum" jdbcType="Integer" javaType="int"/>
|
||||
<result property="callerName" column="caller_name" jdbcType="VARCHAR" javaType="String"/>
|
||||
<result property="appraiseValue" column="renewal_rate" jdbcType="VARCHAR" javaType="String"/>
|
||||
</resultMap>
|
||||
</mapper>
|
@ -6,6 +6,7 @@
|
||||
<!-- 类型别名 -->
|
||||
<typeAliases>
|
||||
<package name="com.cpic.xim.mybatis.pojo" />
|
||||
<package name="com.cpic.xim.utils.ranking" />
|
||||
</typeAliases>
|
||||
|
||||
<environments default="development">
|
||||
|
Loading…
x
Reference in New Issue
Block a user