修改字段

web_backend_develope
chenlw 9 years ago
parent 51c06b3a8a
commit f4d9113d4c

@ -20,9 +20,6 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<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">
@ -41,9 +38,5 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
</if>
</where>
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
</mapper>

@ -19,9 +19,6 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<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">
@ -40,9 +37,6 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
</if>
</where>
order by code
<if test="PagerOptions.limit > 0">
LIMIT #{PagerOptions.limit}
</if>
</select>
</mapper>

@ -32,12 +32,18 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
javaType="string" jdbcType="VARCHAR" />
<result property="collectorName" column="collector_name"
javaType="string" jdbcType="VARCHAR" />
<result property="extractStatus" column="extract_status" jdbcType="INTEGER" />
<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" />
<result property="volumeIp" column="volume_ip" javaType="string"
jdbcType="VARCHAR" />
<result property="volumePath" column="volume_path" javaType="string"
jdbcType="VARCHAR" />
</resultMap>
<sql id="conditionsFilters">
<if test="PagerOptions.dataType!=null">
@ -69,7 +75,7 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<select id="getLimitedDataInfoEntities" parameterType="PagerOptions"
resultMap="getEntityByText">
SELECT
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,data_year
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,extract_status,data_year,start_year,end_year,volume_ip,volume_path
FROM data_details
<if test="PagerOptions!=null">
<where>
@ -145,13 +151,22 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
data_charset,
</if>
<if test="year != null and year != ''">
data_year
data_year,
</if>
<if test="startYear != null and startYear != ''">
start_year
start_year,
</if>
<if test="endYear != null and endYear != ''">
end_year
end_year,
</if>
<if test="volumeIp != null and volumeIp != ''">
volume_ip,
</if>
<if test="volumePath != null and volumePath != ''">
volume_path,
</if>
<if test="extractStatus > 0">
extract_status,
</if>
</trim>
)
@ -188,13 +203,22 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
#{charset},
</if>
<if test="year != null and year != ''">
#{year}
#{year},
</if>
<if test="startYear != null and startYear != ''">
#{start_year}
#{start_year},
</if>
<if test="endYear != null and endYear != ''">
#{end_year}
#{end_year},
</if>
<if test="volumeIp != null and volumeIp != ''">
#{volumeIp},
</if>
<if test="volumePath != null and volumePath != ''">
#{volumePath},
</if>
<if test="extractStatus > 0">
#{extractStatus},
</if>
</trim>
)

@ -43,8 +43,9 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
jdbcType="INTEGER" />
<result property="lastTime" column="lasttime"
javaType="string" jdbcType="VARCHAR" />
<result property="fkid" column="fkid" javaType="int" jdbcType="INTEGER" />
<result property="fkid" column="fkid" javaType="int" jdbcType="INTEGER" />
<result property="dstVolumeIp" column="dst_volume_ip" jdbcType="VARCHAR" />
<result property="dstVolumePath" column="dst_volume_ip" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
@ -54,11 +55,13 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<!-- 获取数据全部记录信息 -->
<select id="findAll" resultType="com.platform.entities.DataInfoEntityMoveTmp">
SELECT
a.id id,a.regionalism_code regionalismCode,b.city_name cityName,b.district_name districtName,
a.system_code systemCode,b.system_name systemName,b.data_type dataType,b.data_version dataVersion,
b.submitted_batch submittedBatch,b.data_path dataPath,b.data_charset charset,b.collection_time collectingTime,
b.collector_name collectorName,b.collector_contacts collectorContacts,b.data_year dataYear,a.dst_path dstPath,
a.complete_status completeStatus,a.rate rate, a.lasttime lastTime
a.id id,a.regionalism_code regionalismCode,a.dst_path dstPath,a.complete_status completeStatus,
a.rate rate, a.lasttime lastTime, a.system_code systemCode,a.dst_volume_ip dstVolumeIp,a.dst_volume_path dstVolumePath,
b.city_name cityName,b.district_name districtName,b.system_name systemName,b.data_type dataType,
b.data_version dataVersion,b.submitted_batch submittedBatch,b.data_path dataPath,b.data_charset charset,
b.collection_time collectingTime,b.collector_name collectorName,b.collector_contacts collectorContacts,
b.data_year year,b.extract_status extractStatus,b.start_year startYear,b.end_year endYear,
b.volume_ip volumeIp,b.volume_path volumePath
FROM
move_data_tmp a LEFT JOIN data_details b
ON a.system_code = b.system_code AND a.regionalism_code = b.regionalism_code AND a.fkid = b.id

@ -35,6 +35,7 @@ import com.platform.entities.PagerOptions;
import com.platform.entities.VolumeEntity;
import com.platform.glusterfs.CheckoutMD5;
import com.platform.service.DataInfoService;
import com.platform.service.ICodeService;
import com.platform.service.IGfsService;
import com.platform.service.IMoveDataService;
import com.platform.service.IMySqlService;
@ -69,6 +70,9 @@ public class DataModelController extends BaseController{
@Resource(name = "moveDataService")
private IMoveDataService moveDataService;
@Resource(name = "codeService")
private ICodeService codeService;
public void setDfsImp(DataInfoService dfs) {
this.dfs = dfs;
}
@ -306,11 +310,11 @@ public class DataModelController extends BaseController{
return result;
}
@RequestMapping(value="/findSystemCode", method= RequestMethod.POST)
@RequestMapping(value="/code/list", method= RequestMethod.POST)
@ResponseBody
public Object findSystemCode(DataInfoEntity move) throws Exception {
public Object findCodeList() throws Exception {
log.debug("---------/findSystemCode-----------------------");
int result = dfs.save(move);
Map<String, Object> result = codeService.findAll();
return result;
}
}

@ -22,11 +22,19 @@ public class DataInfoEntity {
private String charset; // 数据的字符编码
private String collectorName; // 采集人姓名
private String year; // 数据年度
/** 是否抽取 */
private int extractStatus;
/** 数据年度起始 */
private String startYear;
/** 数据年度结束 */
private String endYear;
/** volume的ip */
private String volumeIp;
/** volume的path */
private String volumePath;
public DataInfoEntity() {
}
@ -201,6 +209,48 @@ public class DataInfoEntity {
this.endYear = endYear;
}
/**
* @return the extractStatus
*/
public int getExtractStatus() {
return extractStatus;
}
/**
* @param extractStatus the extractStatus to set
*/
public void setExtractStatus(int extractStatus) {
this.extractStatus = extractStatus;
}
/**
* @return the volumeIp
*/
public String getVolumeIp() {
return volumeIp;
}
/**
* @param volumeIp the volumeIp to set
*/
public void setVolumeIp(String volumeIp) {
this.volumeIp = volumeIp;
}
/**
* @return the volumePath
*/
public String getVolumePath() {
return volumePath;
}
/**
* @param volumePath the volumePath to set
*/
public void setVolumePath(String volumePath) {
this.volumePath = volumePath;
}
@Override
public String toString() {
return "id=" + this.id + " ,regionalismCode=" + this.regionalismCode

@ -8,7 +8,14 @@ public class DataInfoEntityMoveTmp extends DataInfoEntity {
private int rate;
private String lastTime; // 采集时间
/**
*
*/
private String lastTime;
private String dstVolumeIp;
private String dstVolumePath;
private int fkid;
@ -86,4 +93,32 @@ public class DataInfoEntityMoveTmp extends DataInfoEntity {
this.fkid = fkid;
}
/**
* @return the dstVolumeIp
*/
public String getDstVolumeIp() {
return dstVolumeIp;
}
/**
* @param dstVolumeIp the dstVolumeIp to set
*/
public void setDstVolumeIp(String dstVolumeIp) {
this.dstVolumeIp = dstVolumeIp;
}
/**
* @return the dstVolumePath
*/
public String getDstVolumePath() {
return dstVolumePath;
}
/**
* @param dstVolumePath the dstVolumePath to set
*/
public void setDstVolumePath(String dstVolumePath) {
this.dstVolumePath = dstVolumePath;
}
}

@ -12,6 +12,7 @@ package com.platform.service;
import java.util.List;
import java.util.Map;
import com.platform.entities.FolderNode;
import com.platform.entities.RegionalismEntity;
@ -34,4 +35,6 @@ public interface ICodeService {
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception;
public Map<String, Object> findAll() throws Exception;
}

@ -1,10 +1,14 @@
package com.platform.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.platform.dao.DataInfoDao;
import com.platform.dao.IRegionalismCodeDao;
import com.platform.dao.ISystemCodeDao;
@ -12,6 +16,7 @@ import com.platform.entities.RegionalismEntity;
import com.platform.entities.SystemEntity;
import com.platform.service.ICodeService;
@Service(value = "codeService")
public class CodeServiceImpl implements ICodeService {
@Resource(name = "systemCodeDao")
@ -22,16 +27,40 @@ public class CodeServiceImpl implements ICodeService {
@Override
public List<SystemEntity> findSystem(SystemEntity sys) throws Exception {
List<SystemEntity> result = new ArrayList<SystemEntity>();
result = systemCodeDao.findSubSystem(sys);
List<SystemEntity> result = null;
try {
result = new ArrayList<SystemEntity>();
result = systemCodeDao.findSubSystem(sys);
} catch (Exception e) {
// TODO: handle exception
}
return result;
}
@Override
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception {
List<RegionalismEntity> result = regionalismCodeDao.findSubRegionalism(region);
List<RegionalismEntity> result = null;
try {
result = regionalismCodeDao.findSubRegionalism(region);
} catch (Exception e) {
// TODO: handle exception
}
return result;
}
@Override
public Map<String, Object> findAll() throws Exception {
Map<String, Object> result = new HashMap<String, Object>();
try {
List<RegionalismEntity> regions = regionalismCodeDao.findAllRegionalism();
List<SystemEntity> syss = systemCodeDao.findAllSystem();
result.put("system", syss);
result.put("regionalism", regions);
} catch (Exception e) {
// TODO: handle exception
}
return result;
}
}

@ -130,6 +130,8 @@ public class ThreadMoveData{
DataInfoEntity data = (DataInfoEntity) Bean2MapUtils.convertMap(
DataInfoEntity.class, Bean2MapUtils.convertBean(dataMove));
data.setDataPath(dataMove.getDstPath());
data.setVolumeIp(dataMove.getDstVolumeIp());
data.setVolumePath(dataMove.getDstVolumePath());
data.setYear(DateForm.date2StringByMin(new Date()));
dataInfoDao.save(data);
}

Loading…
Cancel
Save