|
|
@@ -2,98 +2,7 @@
|
|
|
<!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>
|
|
|
@@ -101,327 +10,292 @@
|
|
|
$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="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="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="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="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>
|
|
|
+ <select id="queryFtpItemsCount" parameterType="Map"
|
|
|
+ resultType="Integer">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM SAOP_FTP_TASK A
|
|
|
+ WHERE A.STATE = 'A'
|
|
|
|
|
|
- <!-- 修改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>
|
|
|
+ </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>
|
|
|
|
|
|
- <!-- 删除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>
|
|
|
+ <!-- 根据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>
|
|
|
|
|
|
- <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>
|