地区和系统查询

web_backend_develope
chenlw 9 years ago
parent d99c25a92d
commit b19225edbe

@ -9,10 +9,14 @@
<typeAlias alias="PagerOptions" type="com.platform.entities.PagerOptions"/>
<typeAlias alias="GatherOracleInfo" type="com.platform.entities.GatherOracleInfo"/>
<typeAlias alias="DataInfoEntityMoveTmp" type="com.platform.entities.DataInfoEntityMoveTmp"/>
<typeAlias alias="SystemEntity" type="com.platform.entities.SystemEntity"/>
<typeAlias alias="RegionalismEntity" type="com.platform.entities.RegionalismEntity"/>
</typeAliases>
<mappers>
<mapper resource="com/dao/mapper/data-details-mapper.xml" />
<mapper resource="com/dao/mapper/config-details-mapper.xml"/>
<mapper resource="com/dao/mapper/dataInfoMoveTmpmapper.xml"/>
<mapper resource="com/dao/mapper/RegionalismMapper.xml"/>
<mapper resource="com/dao/mapper/SystemCodeMapper.xml"/>
</mappers>
</configuration>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.IRegionalismCodeDao">
<resultMap id="getEntityByText" type="com.platform.entities.RegionalismEntity">
<id property="code" column="code" jdbcType="VARCHAR" />
<result property="cityName" column="city_name" jdbcType="VARCHAR" />
<result property="districtName" column="district_name" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
code,city_name,district_name
</sql>
<!-- 获取数据全部记录信息 -->
<select id="findAllRegionalism" resultMap="getEntityByText">
SELECT
<include refid="Base_Column_List" />
FROM regionalism_info
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
<select id="findSubRegionalism" parameterType="com.platform.entities.RegionalismEntity" resultMap="getEntityByText">
SELECT
<include refid="Base_Column_List" />
FROM regionalism_info
<where>
<if test="code != null and code != ''">
AND code LIKE CONCAT(CONCAT('%', #{code}), '%')
</if>
<if test="cityName != null and cityName != ''">
AND city_name LIKE CONCAT(CONCAT('%', #{cityName}), '%')
</if>
<if test="districtName != null and districtName != ''">
AND district_name LIKE CONCAT(CONCAT('%', #{districtName}), '%')
</if>
</where>
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
</mapper>

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.ISystemCodeDao">
<resultMap id="getEntityByText" type="com.platform.entities.SystemEntity">
<id property="code" column="code" jdbcType="INTEGER" />
<result property="systemName" column="system_name" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
code,system_name
</sql>
<!-- 获取数据全部记录信息 -->
<select id="findAllSystem" resultMap="getEntityByText">
SELECT
<include refid="Base_Column_List" />
FROM system_info
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
<select id="findSubSystem" parameterType="com.platform.entities.SystemEntity" resultMap="getEntityByText">
SELECT
<include refid="Base_Column_List" />
FROM system_info
<where>
<if test="code > 0">
AND code = #{code}
</if>
<if test="cityName != null and cityName != ''">
AND city_name LIKE CONCAT(CONCAT('%', #{cityName}), '%')
</if>
<if test="districtName != null and districtName != ''">
AND district_name LIKE CONCAT(CONCAT('%', #{districtName}), '%')
</if>
</where>
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
</mapper>

@ -34,6 +34,10 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
javaType="string" jdbcType="VARCHAR" />
<result property="year" column="data_year" javaType="string"
jdbcType="VARCHAR" />
<result property="startYear" column="start_year" javaType="string"
jdbcType="VARCHAR" />
<result property="endYear" column="end_year" javaType="string"
jdbcType="VARCHAR" />
</resultMap>
<sql id="conditionsFilters">
<if test="PagerOptions.dataType!=null">
@ -143,6 +147,12 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<if test="year != null and year != ''">
data_year
</if>
<if test="startYear != null and startYear != ''">
start_year
</if>
<if test="endYear != null and endYear != ''">
end_year
</if>
</trim>
)
VALUES(
@ -180,6 +190,12 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<if test="year != null and year != ''">
#{year}
</if>
<if test="startYear != null and startYear != ''">
#{start_year}
</if>
<if test="endYear != null and endYear != ''">
#{end_year}
</if>
</trim>
)
</insert>

@ -306,4 +306,11 @@ public class DataModelController extends BaseController{
return result;
}
@RequestMapping(value="/findSystemCode", method= RequestMethod.POST)
@ResponseBody
public Object findSystemCode(DataInfoEntity move) throws Exception {
log.debug("---------/findSystemCode-----------------------");
int result = dfs.save(move);
return result;
}
}

@ -0,0 +1,28 @@
package com.platform.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.platform.entities.DataInfoEntity;
import com.platform.entities.DataInfoEntityMoveTmp;
import com.platform.entities.PagerOptions;
import com.platform.entities.RegionalismEntity;
/**
* @author chen
*
*/
@Repository(value = "regionalismCodeDao")
public interface IRegionalismCodeDao {
/**
* @return
* @throws Exception
*/
List<RegionalismEntity> findAllRegionalism() throws Exception;
List<RegionalismEntity> findSubRegionalism(RegionalismEntity region) throws Exception;
}

@ -0,0 +1,28 @@
package com.platform.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.platform.entities.DataInfoEntity;
import com.platform.entities.DataInfoEntityMoveTmp;
import com.platform.entities.PagerOptions;
import com.platform.entities.RegionalismEntity;
import com.platform.entities.SystemEntity;
/**
* @author chen
*
*/
@Repository(value = "systemCodeDao")
public interface ISystemCodeDao {
/**
* @return
* @throws Exception
*/
List<SystemEntity> findAllSystem() throws Exception;
List<SystemEntity> findSubSystem(SystemEntity system) throws Exception;
}

@ -22,6 +22,10 @@ public class DataInfoEntity {
private String charset; // 数据的字符编码
private String collectorName; // 采集人姓名
private String year; // 数据年度
/** 数据年度起始 */
private String startYear;
/** 数据年度结束 */
private String endYear;
public DataInfoEntity() {
}
@ -169,6 +173,34 @@ public class DataInfoEntity {
this.year = year;
}
/**
* @return the startYear
*/
public String getStartYear() {
return startYear;
}
/**
* @param startYear the startYear to set
*/
public void setStartYear(String startYear) {
this.startYear = startYear;
}
/**
* @return the endYear
*/
public String getEndYear() {
return endYear;
}
/**
* @param endYear the endYear to set
*/
public void setEndYear(String endYear) {
this.endYear = endYear;
}
@Override
public String toString() {
return "id=" + this.id + " ,regionalismCode=" + this.regionalismCode
@ -180,7 +212,8 @@ public class DataInfoEntity {
+ this.dataPath + " ,collectingTime=" + this.collectingTime
+ " ,collectorContacts=" + this.collectorContacts
+ " ,charset=" + this.charset + " ,collectorName="
+ this.collectorName + " ,year=" + this.year + "";
+ this.collectorName + " ,year=" + this.year + " startYear="
+this.startYear +" endYear="+this.endYear;
}
}

@ -0,0 +1,53 @@
package com.platform.entities;
public class RegionalismEntity {
private String code;
private String cityName;
private String districtName;
/**
* @return the code
*/
public String getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return the cityName
*/
public String getCityName() {
return cityName;
}
/**
* @param cityName the cityName to set
*/
public void setCityName(String cityName) {
this.cityName = cityName;
}
/**
* @return the districtName
*/
public String getDistrictName() {
return districtName;
}
/**
* @param districtName the districtName to set
*/
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
}

@ -0,0 +1,37 @@
package com.platform.entities;
public class SystemEntity {
private int code;
private String systemName;
/**
* @return the code
*/
public int getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(int code) {
this.code = code;
}
/**
* @return the systemName
*/
public String getSystemName() {
return systemName;
}
/**
* @param systemName the systemName to set
*/
public void setSystemName(String systemName) {
this.systemName = systemName;
}
}

@ -0,0 +1,37 @@
/**
* : IGfsService.java
* : </>
* : <>
* @author chen
* : <>
* 201698
* <>
*/
package com.platform.service;
import java.util.List;
import com.platform.entities.FolderNode;
import com.platform.entities.RegionalismEntity;
import com.platform.entities.SystemEntity;
import com.platform.entities.VolumeEntity;
/**
* <>
* <>
* @author chen
* @version [201698]
* @see [/]
* @since [/]
*/
public interface ICodeService {
public List<SystemEntity> findSystem(SystemEntity sys) throws Exception;
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception;
}

@ -0,0 +1,37 @@
package com.platform.service.impl;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import com.platform.dao.DataInfoDao;
import com.platform.dao.IRegionalismCodeDao;
import com.platform.dao.ISystemCodeDao;
import com.platform.entities.RegionalismEntity;
import com.platform.entities.SystemEntity;
import com.platform.service.ICodeService;
public class CodeServiceImpl implements ICodeService {
@Resource(name = "systemCodeDao")
private ISystemCodeDao systemCodeDao;
@Resource(name = "regionalismCodeDao")
private IRegionalismCodeDao regionalismCodeDao;
@Override
public List<SystemEntity> findSystem(SystemEntity sys) throws Exception {
List<SystemEntity> result = new ArrayList<SystemEntity>();
result = systemCodeDao.findSubSystem(sys);
return result;
}
@Override
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception {
List<RegionalismEntity> result = regionalismCodeDao.findSubRegionalism(region);
return result;
}
}

@ -78,6 +78,7 @@ public class ThreadMoveData{
//该循环必须 循环每个,不能有 break;
// rate:大小:假的,待换成真实比例
double realRate = 0.00;
int moveFileCurrNum = 0;
for (int i = 0; i < rsize; i++) {
DataInfoEntityMoveTmp dataMove = result.get(i);
//如果拷贝进度超过20分钟未进行-- 判断为 迁移失败。
@ -89,7 +90,11 @@ public class ThreadMoveData{
dataMove.setCompleteStatus("3");
dataInfoMoveTmpDao.update(dataMove);
}
isNoMove = false;
//正在上传的个数。
moveFileCurrNum++;
if (moveFileCurrNum >= Constant.moveFileMaxNum) {
isNoMove = false;
}
// 查询大小:。//gfs 获取size
long srcSize = show.getFolderSize(dataMove.getDataPath());
long dstSize = show.getFolderSize(dataMove.getDstPath());
@ -158,6 +163,7 @@ public class ThreadMoveData{
if (matcher2.find()) {
dstPath = dstPath.substring(0, dstPath.length()-1);
}
//数据迁移。
copy.copyFolder(dstPath+"/app", next2move.getDstPath());
// "1" :正在上传0等待 迁移, 2成功 3失败
next2move.setCompleteStatus("1");

@ -30,7 +30,11 @@ public class Constant {
+ "echo \\$path \n fi\n done\n}\n\nIFS=\\$\\'\\n\\' "
+ "#这个必须要,否则会在文件名中有空格时出错\nINIT_PATH=\".\";\nergodic \\$1\n";
/**
* volume 线
*/
public final static int moveFileMaxNum = 1;
/**

Loading…
Cancel
Save