20190725 修改了job实现类 使用了job根类
| | |
| | | <artifactItem> |
| | | <groupId>com.java110</groupId> |
| | | <artifactId>java110-config</artifactId> |
| | | <!--<testFailureIgnore>true</testFailureIgnore>--> |
| | | <version>${microcommunity.version}</version> |
| | | <type>jar</type> |
| | | <overWrite>true</overWrite> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.java110.user.UserServiceApplicationStart</mainClass> |
| | | <mainClass>com.java110.job.Java110JobserviceApplication</mainClass> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.nio.charset.Charset; |
| | |
| | | ) |
| | | @EnableDiscoveryClient |
| | | @EnableFeignClients(basePackages = {"com.java110.core.smo.community"}) |
| | | @EnableScheduling |
| | | public class Java110JobserviceApplication { |
| | | private static Logger logger = LoggerFactory.getLogger(Java110JobserviceApplication.class); |
| | | |
| | |
| | | |
| | | public long saveTaskRunLog(FtpTaskLog loginfo){ |
| | | // TODO Auto-generated method stub |
| | | return sqlSessionTemplate.insert("PrvncFtpFileDAO.saveTaskRunLog",loginfo); |
| | | return sqlSessionTemplate.insert("prvncFtpFileDAOImpl.saveTaskRunLog",loginfo); |
| | | } |
| | | |
| | | public void updateTaskRunLog(FtpTaskLog loginfo){ |
| | | // TODO Auto-generated method stub |
| | | sqlSessionTemplate.update("PrvncFtpFileDAO.updateTaskRunLog",loginfo); |
| | | sqlSessionTemplate.update("prvncFtpFileDAOImpl.updateTaskRunLog",loginfo); |
| | | } |
| | | public int saveTaskRunDetailLog(FtpTaskLogDetail logdetail){ |
| | | // TODO Auto-generated method stub |
| | | return sqlSessionTemplate.insert("PrvncFtpFileDAO.saveTaskRunDetailLog",logdetail); |
| | | return sqlSessionTemplate.insert("prvncFtpFileDAOImpl.saveTaskRunDetailLog",logdetail); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List execConfigSql(String dbsql){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.execConfigSql", dbsql); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.execConfigSql", dbsql); |
| | | } |
| | | /** |
| | | * 查询文件下载在文件系统的配置任务列表 |
| | |
| | | public Map queryFtpItems(Map info){ |
| | | Map resultInfo = new HashMap(); |
| | | //1.0查询总数 |
| | | Integer allCNT = (Integer) sqlSessionTemplate.selectOne("PrvncFtpFileDAO.queryFtpItemsCount", info); |
| | | Integer allCNT = (Integer) sqlSessionTemplate.selectOne("prvncFtpFileDAOImpl.queryFtpItemsCount", info); |
| | | resultInfo.put("ITEMSCOUNT", allCNT); |
| | | List datas = sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryFtpItems",info); |
| | | List datas = sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryFtpItems",info); |
| | | resultInfo.put("DATA", datas); |
| | | return resultInfo; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public long newCreateTaskId(){ |
| | | Long tastId = (Long) sqlSessionTemplate.selectOne("PrvncFtpFileDAO.newCreateTaskId"); |
| | | Long tastId = (Long) sqlSessionTemplate.selectOne("prvncFtpFileDAOImpl.newCreateTaskId"); |
| | | return tastId; |
| | | } |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public int addFtpItem(Map info){ |
| | | // return Integer.parseInt(sqlSessionTemplate.insert("PrvncFtpFileDAO.addFtpItem", info).toString()); |
| | | sqlSessionTemplate.insert("PrvncFtpFileDAO.addFtpItem", info); |
| | | // return Integer.parseInt(sqlSessionTemplate.insert("prvncFtpFileDAOImpl.addFtpItem", info).toString()); |
| | | sqlSessionTemplate.insert("prvncFtpFileDAOImpl.addFtpItem", info); |
| | | return 1; |
| | | } |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public Map queryFtpItemByTaskId(Map info){ |
| | | Object data = sqlSessionTemplate.selectOne("PrvncFtpFileDAO.queryFtpItemByTaskId", info); |
| | | Object data = sqlSessionTemplate.selectOne("prvncFtpFileDAOImpl.queryFtpItemByTaskId", info); |
| | | Map ftpItem = null ; |
| | | if(data != null){ |
| | | ftpItem = (Map)data; |
| | | //查ftpitem属性 |
| | | List<Map> ftpItemAttrs = sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryFtpItemAttrsByTaskId",info); |
| | | List<Map> ftpItemAttrs = sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryFtpItemAttrsByTaskId",info); |
| | | ftpItem.put("FTP_ITEM_ATTRS", ftpItemAttrs); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public List<Map> searchFtpItemByTaskName(Map info){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.searchFtpItemByTaskName",info); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.searchFtpItemByTaskName",info); |
| | | } |
| | | /** |
| | | * 修改ftp配置信息 |
| | |
| | | * @return |
| | | */ |
| | | public int updateFtpItemByTaskId(Map info){ |
| | | return sqlSessionTemplate.update("PrvncFtpFileDAO.updateFtpItemByTaskId", info); |
| | | return sqlSessionTemplate.update("prvncFtpFileDAOImpl.updateFtpItemByTaskId", info); |
| | | } |
| | | /** |
| | | * 删除ftp配置信息 |
| | |
| | | * @return |
| | | */ |
| | | public int deleteFtpItemByTaskId(Map info){ |
| | | return sqlSessionTemplate.update("PrvncFtpFileDAO.deleteFtpItemByTaskId", info); |
| | | return sqlSessionTemplate.update("prvncFtpFileDAOImpl.deleteFtpItemByTaskId", info); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public List<Map> queryFtpItemsByTaskIds(Map info){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryFtpItemsByTaskIds",info); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryFtpItemsByTaskIds",info); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public List<Map> queryFtpItemAttrsByTaskId(Map info){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryFtpItemAttrsByTaskId",info); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryFtpItemAttrsByTaskId",info); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public int deleteFtpItemAttrsbyTaskId(Map info){ |
| | | return sqlSessionTemplate.delete("PrvncFtpFileDAO.deleteFtpItemAttrsbyTaskId", info); |
| | | return sqlSessionTemplate.delete("prvncFtpFileDAOImpl.deleteFtpItemAttrsbyTaskId", info); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | para.put("tablename", tablename.toUpperCase()); |
| | | para.put("colnames", "'"+colnames.toUpperCase().replaceAll(",", "','")+"'"); |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryTableColInfo",para); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryTableColInfo",para); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public int addFtpItemAttrs(List<Map> infos){ |
| | | for(Map info :infos){ |
| | | sqlSessionTemplate.insert("PrvncFtpFileDAO.addFtpItemAttrs",info); |
| | | sqlSessionTemplate.insert("prvncFtpFileDAOImpl.addFtpItemAttrs",info); |
| | | } |
| | | |
| | | return 1; |
| | |
| | | * @return |
| | | */ |
| | | public List<Map> queryFileNamesWithOutFtpLog(Map info){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryFileNamesWithOutFtpLog",info); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryFileNamesWithOutFtpLog",info); |
| | | } |
| | | /** |
| | | * 查询ItemSpec |
| | |
| | | * @return |
| | | */ |
| | | public List<Map> queryItemSpec(Map info){ |
| | | return sqlSessionTemplate.selectList("PrvncFtpFileDAO.queryItemSpec",info); |
| | | return sqlSessionTemplate.selectList("prvncFtpFileDAOImpl.queryItemSpec",info); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public int updateFtpItemRunState(Map info){ |
| | | return sqlSessionTemplate.update("PrvncFtpFileDAO.updateFtpItemRunState", info); |
| | | return sqlSessionTemplate.update("prvncFtpFileDAOImpl.updateFtpItemRunState", info); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public int addDownloadFileName(Map info){ |
| | | // return Integer.parseInt(getSqlMapClientTemplate().insert("PrvncFtpFileDAO.addDownloadFileName", info).toString()); |
| | | // return Integer.parseInt(getSqlMapClientTemplate().insert("prvncFtpFileDAOImpl.addDownloadFileName", info).toString()); |
| | | |
| | | return sqlSessionTemplate.insert("PrvncFtpFileDAO.addDownloadFileName", info); |
| | | return sqlSessionTemplate.insert("prvncFtpFileDAOImpl.addDownloadFileName", info); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void saveDbFunction(String function){ |
| | | Map para=new HashMap(); |
| | | para.put("functionname", function); |
| | | sqlSessionTemplate.selectOne("PrvncFtpFileDAO.calltaskfunction",para); |
| | | sqlSessionTemplate.selectOne("prvncFtpFileDAOImpl.calltaskfunction",para); |
| | | } |
| | | |
| | | /** |
| | | * 执行存过(带参数),处理任务执行前后的事情 |
| | | */ |
| | | public void saveDbFunctionWithParam(Map info){ |
| | | sqlSessionTemplate.selectOne("PrvncFtpFileDAO.calltaskfunctionwithparam",info); |
| | | sqlSessionTemplate.selectOne("prvncFtpFileDAOImpl.calltaskfunctionwithparam",info); |
| | | } |
| | | |
| | | public void insertFileData2Table(String insertSQL){ |
| | | // TODO Auto-generated method stub |
| | | sqlSessionTemplate.update("PrvncFtpFileDAO.insertFileData2Table",insertSQL); |
| | | sqlSessionTemplate.update("prvncFtpFileDAOImpl.insertFileData2Table",insertSQL); |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param ftpItemConfigInfo |
| | | */ |
| | | public void startFtpTask(Map ftpItemConfigInfo) throws Exception { |
| | | public void startFtpTask(Map ftpItemConfigInfo) throws Exception { |
| | | |
| | | // 这么做是为了,单线程调用,防止多线程导致数据重复处理 |
| | | if (!ftpItemConfigInfo.containsKey("RUN_STATE") || "R".equals(ftpItemConfigInfo.get("RUN_STATE"))) { |
| | |
| | | import com.java110.common.util.SpringBeanInvoker; |
| | | import com.java110.job.dao.IPrvncFtpFileDAO; |
| | | import com.java110.job.smo.PrvncFtpToFileSystemQuartz; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 将集团文件同步至本地支持的文件系统 |
| | | * |
| | | * |
| | | * @author wuxw7 |
| | | * |
| | | * |
| | | */ |
| | | |
| | | public class PrvncFtpToFileSystemJob extends MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob { |
| | | |
| | | public class PrvncFtpToFileSystemJob implements Job { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(PrvncFtpToFileSystemJob.class); |
| | | |
| | | public static String JOB_DATA_CONFIG_NAME = "ftpToFileSystemTaskName"; |
| | |
| | | private IPrvncFtpFileDAO prvncFtpFileDAO; |
| | | @Autowired |
| | | private PrvncFtpToFileSystemQuartz prvncDumpQuartz; |
| | | |
| | | |
| | | protected void executeInternal(JobExecutionContext context) { |
| | | try { |
| | | |
| | | |
| | | if(logger.isDebugEnabled()){ |
| | | logger.debug("FTP通用数据文件传接任务:" + |
| | | context.getJobDetail().getFullName() + " taskID:" + |
| | | context.getJobDetail().getJobDataMap().get(JOB_DATA_TASK_ID) + |
| | | " ftpfileTaskName:" + |
| | | context.getJobDetail().getJobDataMap().get(JOB_DATA_CONFIG_NAME), context); |
| | | context.getJobDetail().getFullName() + " taskID:" + |
| | | context.getJobDetail().getJobDataMap().get(JOB_DATA_TASK_ID) + |
| | | " ftpfileTaskName:" + |
| | | context.getJobDetail().getJobDataMap().get(JOB_DATA_CONFIG_NAME), context); |
| | | } |
| | | |
| | | long taskId = Long.parseLong(context.getJobDetail().getJobDataMap() |
| | | .getString(JOB_DATA_TASK_ID)); |
| | | // 根据taskId 查询配置信息 |
| | | Map ftpItemConfigInfo = this.getFtpConfigInfo(taskId); |
| | | |
| | | |
| | | //如果查询不到数据,或者是没有处理class,不在运行 |
| | | if(ftpItemConfigInfo == null || !ftpItemConfigInfo.containsKey("DEAL_CLASS") || ftpItemConfigInfo.get("DEAL_CLASS") == null){ |
| | | logger.error("---【PrvncFtpToFileSystemQuartz.executeInternal】查询到的ftp配置数据为空,或没有处理类", ftpItemConfigInfo); |
| | | return; |
| | | } |
| | | |
| | | |
| | | String dealClass = ftpItemConfigInfo.get("DEAL_CLASS").toString(); |
| | | prvncDumpQuartz = (PrvncFtpToFileSystemQuartz) SpringBeanInvoker.getBean(dealClass); |
| | | prvncDumpQuartz.startFtpTask(ftpItemConfigInfo); |
| | |
| | | |
| | | /** |
| | | * 查询配置相关信息 |
| | | * |
| | | * |
| | | * @param taskId |
| | | * @return |
| | | */ |
| | |
| | | return prvncFtpFileDAO; |
| | | } |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | this.executeInternal(jobExecutionContext); |
| | | } |
| | | } |
| New file |
| | |
| | | #quartz集群配置 |
| | | # =========================================================================== |
| | | # Configure Main Scheduler Properties 调度器属性 |
| | | # =========================================================================== |
| | | #调度标识名 集群中每一个实例都必须使用相同的名称 |
| | | org.quartz.scheduler.instanceName=DefaultQuartzScheduler |
| | | #ID设置为自动获取 每一个必须不同 |
| | | org.quartz.scheduler.instanceid=AUTO |
| | | #============================================================================ |
| | | # Configure ThreadPool |
| | | #============================================================================ |
| | | #线程池的实现类(一般使用SimpleThreadPool即可满足几乎所有用户的需求) |
| | | org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool |
| | | #指定线程数,至少为1(无默认值)(一般设置为1-100直接的整数合适) |
| | | org.quartz.threadPool.threadCount = 20 |
| | | #设置线程的优先级(最大为java.lang.Thread.MAX_PRIORITY 10,最小为Thread.MIN_PRIORITY 1,默认为5) |
| | | org.quartz.threadPool.threadPriority = 5 |
| | | #============================================================================ |
| | | # Configure JobStore |
| | | #============================================================================ |
| | | # 信息保存时间 默认值60秒 |
| | | org.quartz.jobStore.misfireThreshold = 60000 |
| | | #数据保存方式为数据库持久化 |
| | | org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | #数据库代理类,一般org.quartz.impl.jdbcjobstore.StdJDBCDelegate可以满足大部分数据库 |
| | | org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate |
| | | #JobDataMaps是否都为String类型 |
| | | org.quartz.jobStore.useProperties = false |
| | | #数据库别名 随便取 |
| | | org.quartz.jobStore.dataSource = myDS |
| | | #表的前缀,默认QRTZ_ |
| | | org.quartz.jobStore.tablePrefix = HC |
| | | #是否加入集群 |
| | | org.quartz.jobStore.isClustered = true |
| | | #调度实例失效的检查时间间隔 |
| | | org.quartz.jobStore.clusterCheckinInterval = 20000 |
| | | #============================================================================ |
| | | # Configure Datasources |
| | | #============================================================================ |
| | | #数据库引擎 |
| | | org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver |
| | | #数据库连接 |
| | | org.quartz.dataSource.myDS.URL = jdbc:mysql://localhost:3306/testdb?characterEncoding=utf8&allowMultiQueries=true&useSSL=false&autoReconnect=true |
| | | #数据库用户 |
| | | org.quartz.dataSource.myDS.user = root |
| | | #数据库密码 |
| | | org.quartz.dataSource.myDS.password = root |
| | | #允许最大连接 |
| | | org.quartz.dataSource.myDS.maxConnections = 5 |
| | | #验证查询sql,可以不设置 |
| | | org.quartz.dataSource.myDS.validationQuery=select 0 from dual |
| | |
| | | import com.java110.core.base.AppBase; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import redis.clients.jedis.JedisPool; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * 负责和数据库交互基类 |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="PrvncFtpFileDAO"> |
| | | |
| | | |
| | | <insert id="saveTaskInfo" |
| | | parameterType="com.java110.job.model.FtpTaskInfo"> |
| | | <selectKey keyProperty="taskid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS taskid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into |
| | | CEP_FTP_TASK(taskid,taskname,taskcron,detailid,ftp_userid,p_path,l_path,file_name,create_date,state,u_or_d,ERRPHONE,tnum,upnull) |
| | | values(#taskid#,#taskname#,#taskcron#,#detailid#,#userid#,#ppath#,#lpath#,#filename#,sysdate,#state#,#uord#,#errphone#,#tnum#,#upnull#) |
| | | </insert> |
| | | |
| | | <insert id="saveTaskDetailInfo" |
| | | parameterType="com.java110.job.model.FtpTaskDetail"> |
| | | <selectKey keyProperty="detailid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS detailid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into |
| | | CEP_FTP_TASKDETAIL(detailid,name,dbsql,titleflag,title,linecountflag,linecountname,sign,state,create_date, |
| | | preflag,prefunction,afterflag,afterfunction,filesplitflag,singlesplitsize) |
| | | values(#detailid#,#name#,#dbsql#,#titleflag#,#title#,#linecountflag#,#linecountname#,#sign#,#state#,sysdate, |
| | | #preflag#,#prefunction#,#afterflag#,#afterfunction#,#filesplitflag#,#singlesplitsize#) |
| | | </insert> |
| | | <update id="updateTaskDetailInfo" |
| | | parameterType="com.java110.job.model.FtpTaskDetail"> |
| | | update CEP_FTP_TASKDETAIL |
| | | set |
| | | name=#name#,dbsql=#dbsql#,titleflag=#titleflag#,title=#title#,linecountflag=#linecountflag#,linecountname=#linecountname#,sign=#sign#,state=#state#, |
| | | preflag=#preflag#,prefunction=#prefunction#,afterflag=#afterflag#,afterfunction=#afterfunction#,filesplitflag=#filesplitflag#,singlesplitsize=#singlesplitsize# |
| | | where detailid=#detailid# |
| | | </update> |
| | | <delete id="deleteTaskDetailInfo" parameterType="long"> |
| | | delete from |
| | | CEP_FTP_TASKDETAIL where taskid=#value# |
| | | </delete> |
| | | <insert id="saveFtpUserInfo" |
| | | parameterType="com.java110.job.model.FtpUserInfo"> |
| | | <selectKey keyProperty="userid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS userid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into |
| | | CEP_FTP_TASKUSER(ftp_userid,machine_id,username,pwd,ip,port,create_date,state,remark) |
| | | values(#userid#,#machineid#,#username#,#pwd#,#ip#,#port#,sysdate,#state#,#remark#) |
| | | </insert> |
| | | |
| | | <insert id="saveTaskRunLog" |
| | | parameterType="com.java110.job.model.FtpTaskLog"> |
| | | <selectKey keyProperty="logid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_ftptasklog.NEXTVAL AS logid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into |
| | | cep_ftp_tasklog(logid,taskid,u_or_d,create_date,state,serverfilename,localfilename,filelength) |
| | | values(#logid#,#taskid#,#uord#,sysdate,#state#,#serverfilename#,#localfilename#,#filelength#) |
| | | </insert> |
| | | |
| | | <update id="updateTaskRunLog" |
| | | parameterType="com.java110.job.model.FtpTaskLog"> |
| | | update cep_ftp_tasklog set update_date=sysdate |
| | | <if test="state !=null and state != ''"> |
| | | ,state = #state# |
| | | </if> |
| | | where logid=#logid# |
| | | </update> |
| | | <insert id="saveTaskRunDetailLog" |
| | | parameterType="com.java110.job.model.FtpTaskLogDetail"> |
| | | <selectKey keyProperty="id" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_ftptasklogdetail.NEXTVAL AS id from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into |
| | | cep_ftp_tasklog_detail(id,logid,taskid,create_date,state,tnum,begin,end,data,havedown,remark,SERVERFILENAME,LOCALFILENAME) |
| | | values(#id#,#logid#,#taskid#,sysdate,#state#,#tnum#,#begin#,#end#,#data#,#havedown#,#remark#,#serverfilename#,#localfilename#) |
| | | </insert> |
| | | <update id="updateTaskRunDetailLog" |
| | | parameterType="com.java110.job.model.FtpTaskLogDetail"> |
| | | update cep_ftp_tasklog_detail set update_date=sysdate |
| | | <if test="state !=null and state != ''">,state = #state#</if> |
| | | <if test="data !=null and data != ''">,data = #data#</if> |
| | | <if test="havedown !=null and havedown != ''">,havedown = #havedown#</if> |
| | | <if test="remark !=null and remark != ''">,remark = #remark#</if> |
| | | where id=#id# |
| | | </update> |
| | | <mapper namespace="prvncFtpFileDAOImpl"> |
| | | <insert id="insertFileData2Table" parameterType="String"> |
| | | $value$ |
| | | </insert> |
| | |
| | | $value$ |
| | | </insert> |
| | | |
| | | <select id="calltaskfunction" parameterType="map"> |
| | | { call $functionname$()} |
| | | <select id="calltaskfunction" parameterType="Map"> |
| | | { call ${functionname}()} |
| | | </select> |
| | | |
| | | <!-- |
| | | |
| | | <select id="calltaskfunctionwithparam" parameterMap="TaskFunctionProcParameters"> |
| | | { call $functionname$(?,?)} |
| | | </select> |
| | | <select id="calltaskfunctionwithparam" parameterMap="Map"> |
| | | { call ${functionname}(?,?)} |
| | | </select> |
| | | --> |
| | | |
| | | <insert id="addFtpItem" parameterType="Map"> |
| | | insert into saop_ftp_task(taskid, |
| | | taskname, |
| | | file_name, |
| | | u_or_d, |
| | | tnum, |
| | | taskcron, |
| | | errphone, |
| | | fileseq, |
| | | upnull, |
| | | preflag, |
| | | prefunction, |
| | | afterflag, |
| | | afterfunction, |
| | | deal_class) |
| | | values(#{taskId}, |
| | | #{taskName}, |
| | | #{fileName}, |
| | | #{uOrD}, |
| | | #{tNum}, |
| | | #{taskCron}, |
| | | #{errPhone}, |
| | | #{fileSeq}, |
| | | #{upNull}, |
| | | #{preFlag}, |
| | | #{preFunction}, |
| | | #{afterFlag}, |
| | | #{afterFunction}, |
| | | #{dealClass} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <insert id="addFtpItem" parameterType="map"> |
| | | insert into saop_ftp_task(taskid, |
| | | taskname, |
| | | file_name, |
| | | u_or_d, |
| | | tnum, |
| | | taskcron, |
| | | errphone, |
| | | fileseq, |
| | | upnull, |
| | | preflag, |
| | | prefunction, |
| | | afterflag, |
| | | afterfunction, |
| | | deal_class) |
| | | values(#taskId#, |
| | | #taskName#, |
| | | #fileName#, |
| | | #uOrD#, |
| | | #tNum#, |
| | | #taskCron#, |
| | | #errPhone#, |
| | | #fileSeq#, |
| | | #upNull#, |
| | | #preFlag#, |
| | | #preFunction#, |
| | | #afterFlag#, |
| | | #afterFunction#, |
| | | #dealClass# |
| | | ) |
| | | </insert> |
| | | <update id="updateTaskRunLog" |
| | | parameterType="com.java110.job.model.FtpTaskLog"> |
| | | update cep_ftp_tasklog set update_date=sysdate |
| | | <if test="state != null and state != ''">,state = #state#</if> |
| | | where logid=#logid# |
| | | </update> |
| | | |
| | | <select id="queryTaskDetailInfo" parameterType="long" |
| | | resultType="Map"> |
| | | select * from CEP_FTP_TASKDETAIL |
| | | where detailid=#{value} |
| | | </select> |
| | | <select id="queryFtpUserInfo" parameterType="long" resultType="Map"> |
| | | select ftp_userid,machine_id,username,pwd,ip,port, |
| | | state, |
| | | to_char(update_date,'yyyy-mm-dd hh24:mi:ss') updatedate, |
| | | to_char(create_date,'yyyy-mm-dd hh24:mi:ss') createdate, |
| | | remark |
| | | from CEP_FTP_TASKUSER |
| | | where ftp_userid=#{value} |
| | | </select> |
| | | |
| | | |
| | | <select id="queryTaskDetailInfo" parameterType="long" |
| | | resultType="java.util.HashMap"> |
| | | select * from CEP_FTP_TASKDETAIL |
| | | where detailid=#value# |
| | | </select> |
| | | <select id="queryFtpUserInfo" parameterType="long" resultType="java.util.HashMap"> |
| | | select ftp_userid,machine_id,username,pwd,ip,port, |
| | | state, |
| | | to_char(update_date,'yyyy-mm-dd hh24:mi:ss') updatedate, |
| | | to_char(create_date,'yyyy-mm-dd hh24:mi:ss') createdate, |
| | | remark |
| | | from CEP_FTP_TASKUSER |
| | | where ftp_userid=#value# |
| | | </select> |
| | | <select id="execConfigSql" parameterType="String" resultType="String"> |
| | | $value$ |
| | | </select> |
| | | |
| | | |
| | | <select id="execConfigSql" parameterType="String" resultType="String"> |
| | | $value$ |
| | | </select> |
| | | <select id="queryFtpItemsCount" parameterType="Map" |
| | | resultType="Integer"> |
| | | SELECT count(1) |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | |
| | | </select> |
| | | <!-- 查询文件下载上传列表(配置项) --> |
| | | <select id="queryFtpItems" parameterType="Map" resultType="Map"> |
| | | <![CDATA[ |
| | | select * from ( |
| | | SELECT rownum as rn,A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A') A1 |
| | | where A1.rn > ((TO_NUMBER(#{curPage}) -1) * TO_NUMBER(#{pageSize})) AND A1.rn <= (TO_NUMBER(#{curPage}) * TO_NUMBER(#{pageSize})) |
| | | ]]> |
| | | </select> |
| | | <select id="newCreateTaskId" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS taskId from dual |
| | | ]]> |
| | | </select> |
| | | |
| | | <!-- 根据taskId 查询FtpItem 信息 --> |
| | | <select id="queryFtpItemByTaskId" parameterType="Map" |
| | | resultType="Map"> |
| | | SELECT A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | and A.TASKID = #{taskId} |
| | | </select> |
| | | <!-- 根据任务名称搜素 --> |
| | | <select id="searchFtpItemByTaskName" parameterType="Map" |
| | | resultType="Map"> |
| | | <![CDATA[ |
| | | SELECT A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | and A.TASKNAME like '%' || #{taskName} || '%' |
| | | and rownum < 1000 |
| | | ]]> |
| | | </select> |
| | | <!-- 修改ftp配置信息 --> |
| | | <update id="updateFtpItemByTaskId" parameterType="Map"> |
| | | update saop_ftp_task sft |
| | | set update_date = sysdate |
| | | <if test="taskName !=null and taskName != ''">,sft.taskname = #{taskName} |
| | | </if> |
| | | <if test="fileName !=null and fileName != ''">,sft.file_name = #{fileName} |
| | | </if> |
| | | <if test="uOrD !=null and uOrD != ''">,sft.u_or_d = #{uOrD}</if> |
| | | <if test="runState !=null and runState != ''">,sft.run_state = #{runState} |
| | | </if> |
| | | <if test="runFlag !=null and runFlag != ''">,sft.run_flag = #{runFlag}</if> |
| | | <if test="tNum !=null and tNum != ''">,sft.tnum = #{tNum}</if> |
| | | <if test="taskCron !=null and taskCron != ''">,sft.taskcron = #{taskCron} |
| | | </if> |
| | | <if test="errPhone !=null and errPhone != ''">,sft.errphone = #{errPhone} |
| | | </if> |
| | | <if test="fileSeq !=null and fileSeq != ''">,sft.fileseq = #{fileSeq}</if> |
| | | <if test="upNull !=null and upNull != ''">,sft.upnull = #{upNull}</if> |
| | | <if test="preFlag !=null and preFlag != ''">,sft.preflag = #{preFlag}</if> |
| | | <if test="preFunction !=null and preFunction != ''">,sft.prefunction = #{preFunction} |
| | | </if> |
| | | <if test="afterFlag !=null and afterFlag != ''">,sft.afterflag = #{afterFlag} </if> |
| | | <if test="afterFunction !=null and afterFunction != ''">,sft.afterfunction = #{afterFunction} |
| | | </if> |
| | | <if test="dealClass !=null and dealClass != ''">,sft.deal_class = #{dealClass} |
| | | </if> |
| | | where sft.state = 'A' |
| | | and sft.taskid = #{taskId} |
| | | </update> |
| | | |
| | | <!-- 修改ftp配置信息 --> |
| | | <update id="updateFtpItemRunState" parameterType="Map"> |
| | | update |
| | | saop_ftp_task sft |
| | | set update_date = sysdate,sft.run_state= #{runState} |
| | | where sft.run_state = #{oldRunState} |
| | | </update> |
| | | |
| | | <!-- 删除ftp配置信息 --> |
| | | <update id="deleteFtpItemByTaskId" parameterType="Map"> |
| | | update |
| | | saop_ftp_task sft |
| | | set sft.state = 'R' |
| | | where sft.state = 'A' |
| | | and sft.taskid in |
| | | <foreach collection="taskIds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | <!-- 根据taskids 获取将要操作的ftp配置信息 --> |
| | | <select id="queryFtpItemsByTaskIds" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | AND A.TASKID in |
| | | <foreach open="(" close=")" |
| | | separator="," collection="taskIds" item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <!-- 查询FTPItem的属性信息 --> |
| | | <select id="queryFtpItemAttrsByTaskId" parameterType="Map" |
| | | resultType="Map"> |
| | | SELECT A.TASKID, A.ITEM_SPEC_ID, A.VALUE |
| | | FROM SAOP_FTP_TASK_ATTR A |
| | | WHERE A.TASKID = #{taskId} |
| | | </select> |
| | | <!-- 保存FTPItem的属性信息 --> |
| | | <insert id="addFtpItemAttrs" parameterType="Map"> |
| | | insert into |
| | | SAOP_FTP_TASK_ATTR(taskid,item_spec_id,value) |
| | | values(#{taskId},#{itemSpecId},#{value}) |
| | | </insert> |
| | | <!-- 查询没有下载过的文件名 --> |
| | | <select id="queryFileNamesWithOutFtpLog" parameterType="Map" |
| | | resultType="Map"> |
| | | <![CDATA[ |
| | | SELECT #{fileNames} AS fileNames FROM DUAL |
| | | where #{fileNames} not in |
| | | (select sfl.file_name from saop_ftp_log sfl where sfl.taskId = #{taskId}) |
| | | ]]> |
| | | </select> |
| | | |
| | | <insert id="addDownloadFileName" parameterType="Map"> |
| | | <selectKey keyProperty="logid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS logid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into saop_ftp_log( |
| | | log_id, |
| | | taskid, |
| | | file_name, |
| | | tfs_file_name |
| | | ) |
| | | values( |
| | | #{logid}, |
| | | #{taskId}, |
| | | #{fileName}, |
| | | #{tfsFileName} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <select id="queryFtpItemsCount" parameterType="map" |
| | | resultType="Integer"> |
| | | SELECT count(1) |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | |
| | | </select> |
| | | <!-- 查询文件下载上传列表(配置项) --> |
| | | <select id="queryFtpItems" parameterType="map" resultType="java.util.HashMap"> |
| | | <![CDATA[ |
| | | select * from ( |
| | | SELECT rownum as rn,A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A') A1 |
| | | where A1.rn > ((TO_NUMBER(#curPage#) -1) * TO_NUMBER(#pageSize#)) AND A1.rn <= (TO_NUMBER(#curPage#) * TO_NUMBER(#pageSize#)) |
| | | ]]> |
| | | </select> |
| | | <select id="newCreateTaskId" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS taskId from dual |
| | | ]]> |
| | | </select> |
| | | <insert id="addFtpItem" parameterType="map"> |
| | | insert into saop_ftp_task(taskid, |
| | | taskname, |
| | | file_name, |
| | | u_or_d, |
| | | tnum, |
| | | taskcron, |
| | | errphone, |
| | | fileseq, |
| | | upnull, |
| | | preflag, |
| | | prefunction, |
| | | afterflag, |
| | | afterfunction, |
| | | deal_class) |
| | | values(#taskId#, |
| | | #taskName#, |
| | | #fileName#, |
| | | #uOrD#, |
| | | #tNum#, |
| | | #taskCron#, |
| | | #errPhone#, |
| | | #fileSeq#, |
| | | #upNull#, |
| | | #preFlag#, |
| | | #preFunction#, |
| | | #afterFlag#, |
| | | #afterFunction#, |
| | | #dealClass# |
| | | ) |
| | | </insert> |
| | | <!-- 根据taskId 查询FtpItem 信息 --> |
| | | <select id="queryFtpItemByTaskId" parameterType="map" |
| | | resultType="java.util.HashMap"> |
| | | SELECT A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | and A.TASKID = #taskId# |
| | | </select> |
| | | <!-- 根据任务名称搜素 --> |
| | | <select id="searchFtpItemByTaskName" parameterType="map" |
| | | resultType="java.util.HashMap"> |
| | | <![CDATA[ |
| | | SELECT A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS, |
| | | A.CREATE_DATE |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | and A.TASKNAME like '%' || #taskName# || '%' |
| | | and rownum < 1000 |
| | | ]]> |
| | | </select> |
| | | <!-- 修改ftp配置信息 --> |
| | | <update id="updateFtpItemByTaskId" parameterType="map"> |
| | | update saop_ftp_task sft |
| | | set update_date = sysdate |
| | | <if test="taskName !=null and taskName != ''">,sft.taskname = #taskName# |
| | | </if> |
| | | <if test="fileName !=null and fileName != ''">,sft.file_name = #fileName# |
| | | </if> |
| | | <if test="uOrD !=null and uOrD != ''">,sft.u_or_d = #uOrD#</if> |
| | | <if test="runState !=null and runState != ''">,sft.run_state = #runState# |
| | | </if> |
| | | <if test="runFlag !=null and runFlag != ''">,sft.run_flag = #runFlag#</if> |
| | | <if test="tNum !=null and tNum != ''">,sft.tnum = #tNum#</if> |
| | | <if test="taskCron !=null and taskCron != ''">,sft.taskcron = #taskCron# |
| | | </if> |
| | | <if test="errPhone !=null and errPhone != ''">,sft.errphone = #errPhone# |
| | | </if> |
| | | <if test="fileSeq !=null and fileSeq != ''">,sft.fileseq = #fileSeq#</if> |
| | | <if test="upNull !=null and upNull != ''">,sft.upnull = #upNull#</if> |
| | | <if test="preFlag !=null and preFlag != ''">,sft.preflag = #preFlag#</if> |
| | | <if test="preFunction !=null and preFunction != ''">,sft.prefunction = #preFunction# |
| | | </if> |
| | | <if test="afterFlag !=null and afterFlag != ''">,sft.afterflag = #afterFlag# |
| | | </if> |
| | | <if test="afterFunction !=null and afterFunction != ''">,sft.afterfunction = #afterFunction# |
| | | </if> |
| | | <if test="dealClass !=null and dealClass != ''">,sft.deal_class = #dealClass# |
| | | </if> |
| | | where sft.state = 'A' |
| | | and sft.taskid = #taskId# |
| | | </update> |
| | | |
| | | <!-- 修改ftp配置信息 --> |
| | | <update id="updateFtpItemRunState" parameterType="map"> |
| | | update |
| | | saop_ftp_task sft |
| | | set update_date = sysdate,sft.run_state= #runState# |
| | | where sft.run_state = #oldRunState# |
| | | </update> |
| | | |
| | | <!-- 删除ftp配置信息 --> |
| | | <update id="deleteFtpItemByTaskId" parameterType="map"> |
| | | update |
| | | saop_ftp_task sft |
| | | set sft.state = 'R' |
| | | where sft.state = 'A' |
| | | and sft.taskid in |
| | | <foreach collection="taskIds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | <!-- 根据taskids 获取将要操作的ftp配置信息 --> |
| | | <select id="queryFtpItemsByTaskIds" parameterType="map" resultType="java.util.HashMap"> |
| | | SELECT |
| | | A.TASKID, |
| | | A.TASKNAME, |
| | | A.FILE_NAME, |
| | | A.U_OR_D, |
| | | A.RUN_STATE, |
| | | A.RUN_FLAG, |
| | | A.TNUM, |
| | | A.TASKCRON, |
| | | A.ERRPHONE, |
| | | A.FILESEQ, |
| | | A.UPNULL, |
| | | A.PREFLAG, |
| | | A.PREFUNCTION, |
| | | A.AFTERFLAG, |
| | | A.AFTERFUNCTION, |
| | | A.DEAL_CLASS |
| | | FROM SAOP_FTP_TASK A |
| | | WHERE A.STATE = 'A' |
| | | AND A.TASKID in |
| | | <foreach open="(" close=")" |
| | | separator="," collection="taskIds" item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <!-- 查询FTPItem的属性信息 --> |
| | | <select id="queryFtpItemAttrsByTaskId" parameterType="map" |
| | | resultType="java.util.HashMap"> |
| | | SELECT A.TASKID, A.ITEM_SPEC_ID, A.VALUE |
| | | FROM SAOP_FTP_TASK_ATTR A |
| | | WHERE A.TASKID = #taskId# |
| | | </select> |
| | | <!-- 保存FTPItem的属性信息 --> |
| | | <insert id="addFtpItemAttrs" parameterType="map"> |
| | | insert into |
| | | SAOP_FTP_TASK_ATTR(taskid,item_spec_id,value) |
| | | values(#taskId#,#itemSpecId#,#value#) |
| | | </insert> |
| | | <!-- 查询没有下载过的文件名 --> |
| | | <select id="queryFileNamesWithOutFtpLog" parameterType="map" |
| | | resultType="java.util.HashMap"> |
| | | <![CDATA[ |
| | | SELECT #fileNames# AS fileNames FROM DUAL |
| | | where #fileNames# not in |
| | | (select sfl.file_name from saop_ftp_log sfl where sfl.taskId = #taskId#) |
| | | ]]> |
| | | </select> |
| | | |
| | | <insert id="addDownloadFileName" parameterType="map"> |
| | | <selectKey keyProperty="logid" resultType="long"> |
| | | <![CDATA[ |
| | | SELECT seq_cep_taskid.NEXTVAL AS logid from dual |
| | | ]]> |
| | | </selectKey> |
| | | insert into saop_ftp_log( |
| | | log_id, |
| | | taskid, |
| | | file_name, |
| | | tfs_file_name |
| | | ) |
| | | values( |
| | | #logid#, |
| | | #taskId#, |
| | | #fileName#, |
| | | #tfsFileName# |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <select id="queryItemSpec" parameterType="map" resultType="java.util.HashMap"> |
| | | select a.item_spec_cd, a.domain, a.name, a.describe, a.create_date |
| | | from saop_ftp_item_spec a |
| | | where a.status_cd = '0' |
| | | <if test="domain != null and domain !='' "> and a.domain = #domain#</if> |
| | | <if test="name != null and name !='' "> and a.name = #name#</if> |
| | | <if test="itemSpecCd != null and itemSpecCd !='' "> and a.item_spec_cd = #itemSpecCd# |
| | | </if> |
| | | </select> |
| | | <select id="queryItemSpec" parameterType="Map" resultType="Map"> |
| | | select a.item_spec_cd, a.domain, a.name, a.describe, a.create_date |
| | | from saop_ftp_item_spec a |
| | | where a.status_cd = '0' |
| | | <if test="domain != null and domain !='' "> and a.domain = #{domain}</if> |
| | | <if test="name != null and name !='' "> and a.name = #{name}</if> |
| | | <if test="itemSpecCd != null and itemSpecCd !='' "> and a.item_spec_cd = #{itemSpecCd} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <dependency> |
| | | <groupId>org.quartz-scheduler</groupId> |
| | | <artifactId>quartz</artifactId> |
| | | <version>2.2.3</version> |
| | | <version>2.3.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |