Commit ee4b0523 authored by yanzg's avatar yanzg

下载视频

parent f1ec68ae
...@@ -5,6 +5,7 @@ import com.yanzuoguang.cloud.vo.YzgFileVo; ...@@ -5,6 +5,7 @@ import com.yanzuoguang.cloud.vo.YzgFileVo;
import com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo; import com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo;
import com.yanzuoguang.dao.DaoConst; import com.yanzuoguang.dao.DaoConst;
import com.yanzuoguang.dao.impl.BaseDaoImpl; import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.MapRow; import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -18,6 +19,8 @@ import java.util.List; ...@@ -18,6 +19,8 @@ import java.util.List;
*/ */
@Component @Component
public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, InitializingBean { public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, InitializingBean {
private static final String GET_COUNT_SQL = "GET_COUNT_SQL";
private static final String UPDATE_STATUS_SQL = "UPDATE_STATUS_SQL";
private static final String QUERY_TABLE_SQL = "SHOW TABLES LIKE 'Yzg_File'"; private static final String QUERY_TABLE_SQL = "SHOW TABLES LIKE 'Yzg_File'";
private static final String CREATE_TABLE_SQL = "CREATE TABLE Yzg_File ( " + private static final String CREATE_TABLE_SQL = "CREATE TABLE Yzg_File ( " +
" fileId VARCHAR(32) NOT NULL COMMENT '编号', " + " fileId VARCHAR(32) NOT NULL COMMENT '编号', " +
...@@ -47,6 +50,15 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ ...@@ -47,6 +50,15 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
getSql(DaoConst.LOAD) getSql(DaoConst.LOAD)
.addCode("{ORDER}", "ORDER BY createDate DESC") .addCode("{ORDER}", "ORDER BY createDate DESC")
; ;
table.add(GET_COUNT_SQL, "SELECT COUNT(1) FROM Yzg_File WHERE 1=1")
.add(YzgFileVo.class, "a.");
table.add(UPDATE_STATUS_SQL, "UPDATE Yzg_File AS a SET a.fileId=a.fileId {FIELD} WHERE a.fileId=@fileId")
.addPara("fileStatus", ",a.fileStatus=CASE WHEN @fileStatus>a.fileStatus THEN @fileStatus ELSE a.fileStatus END")
.addPara("fileRow", ",a.fileRow=CASE WHEN @fileRow>a.fileRow THEN @fileRow ELSE a.fileRow END")
.addPara("errorMessage", ",a.errorMessage=@errorMessage")
;
} }
/** /**
...@@ -77,8 +89,14 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ ...@@ -77,8 +89,14 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/ */
@Override @Override
public int getUserCompanyCount(YzgFileVo req) { public int getUserCompanyCount(YzgFileVo req) {
if (StringHelper.isEmpty(req.getCompanyId(), req.getCreateUserId())) {
return 0; return 0;
} }
YzgFileVo countReq = new YzgFileVo();
countReq.setCompanyId(req.getCompanyId());
countReq.setCreateUserId(req.getCreateUserId());
return StringHelper.toInt(queryCell(GET_COUNT_SQL, countReq));
}
/** /**
* 获取导出文件数量 * 获取导出文件数量
...@@ -88,8 +106,13 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ ...@@ -88,8 +106,13 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/ */
@Override @Override
public int getCallbackCount(YzgFileVo req) { public int getCallbackCount(YzgFileVo req) {
if (StringHelper.isEmpty(req.getCompanyId(), req.getCreateUserId())) {
return 0; return 0;
} }
YzgFileVo countReq = new YzgFileVo();
countReq.setCallbackMQ(req.getCallbackMQ());
return StringHelper.toInt(queryCell(GET_COUNT_SQL, countReq));
}
/** /**
* 修改文件状态 * 修改文件状态
...@@ -99,6 +122,6 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ ...@@ -99,6 +122,6 @@ public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, Initializ
*/ */
@Override @Override
public int updateStatus(YzgFileStatusReqVo req) { public int updateStatus(YzgFileStatusReqVo req) {
return 0; return this.updateSql(UPDATE_STATUS_SQL, req);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment