Commit 6d785989 authored by jiawei's avatar jiawei

BUG修改====》》视频汇出,视频名称检索功能无效

parent 8def55b7
...@@ -29,10 +29,11 @@ public interface AssetMapper extends BaseMapper<Asset> { ...@@ -29,10 +29,11 @@ public interface AssetMapper extends BaseMapper<Asset> {
"<![CDATA[and co.expire_date_start <= DATE_FORMAT(now(), '%Y-%m-%d') ]]>" + "<![CDATA[and co.expire_date_start <= DATE_FORMAT(now(), '%Y-%m-%d') ]]>" +
"<![CDATA[and co.expire_date_end >= DATE_FORMAT(now(), '%Y-%m-%d') ]]>" + "<![CDATA[and co.expire_date_end >= DATE_FORMAT(now(), '%Y-%m-%d') ]]>" +
"<if test='videoContentCatId != null'>and vcc.id = #{videoContentCatId} </if>" + "<if test='videoContentCatId != null'>and vcc.id = #{videoContentCatId} </if>" +
"<if test='nameOrCode != null'>and a.file_name like concat('%',#{nameOrCode},'%') </if>" +
"<if test='videoContentCopyrightOwnerId != null'>and co.id = #{videoContentCopyrightOwnerId} </if>" + "<if test='videoContentCopyrightOwnerId != null'>and co.id = #{videoContentCopyrightOwnerId} </if>" +
"order by a.create_time desc" + "order by a.create_time desc" +
"</script>") "</script>")
Page<Asset> selectPageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId); Page<Asset> selectPageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId,String nameOrCode);
@Select("<script>" + @Select("<script>" +
"SELECT b.*, o.code as organ_code, o.`name` as organ_name " + "SELECT b.*, o.code as organ_code, o.`name` as organ_name " +
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
*/ */
public interface AssetService extends IService<Asset> { public interface AssetService extends IService<Asset> {
Page<Asset> pageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId); Page<Asset> pageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId,String nameOrCode);
List<TBoxOperation> listBoxByOrgan(); List<TBoxOperation> listBoxByOrgan();
......
...@@ -26,8 +26,8 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements ...@@ -26,8 +26,8 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
private AssetMapper assetMapper; private AssetMapper assetMapper;
@Override @Override
public Page<Asset> pageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId) { public Page<Asset> pageByConditions(Page<Object> page, String videoContentCatId, String videoContentCopyrightOwnerId,String nameOrCode) {
return assetMapper.selectPageByConditions(page, videoContentCatId, videoContentCopyrightOwnerId); return assetMapper.selectPageByConditions(page, videoContentCatId, videoContentCopyrightOwnerId,nameOrCode);
} }
@Override @Override
......
...@@ -14,7 +14,6 @@ import cn.chnmuseum.party.service.AssetService; ...@@ -14,7 +14,6 @@ import cn.chnmuseum.party.service.AssetService;
import cn.chnmuseum.party.web.controller.base.BaseController; import cn.chnmuseum.party.web.controller.base.BaseController;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ZipUtil; import cn.hutool.core.util.ZipUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -71,15 +70,17 @@ public class AssetController extends BaseController { ...@@ -71,15 +70,17 @@ public class AssetController extends BaseController {
public Map<String, Object> getAssetPageList(GenericPageParam genericPageParam, public Map<String, Object> getAssetPageList(GenericPageParam genericPageParam,
@RequestParam(value = "videoContentCatId", required = false) String videoContentCatId, @RequestParam(value = "videoContentCatId", required = false) String videoContentCatId,
@RequestParam(value = "videoContentCopyrightOwnerId", required = false) String videoContentCopyrightOwnerId) { @RequestParam(value = "videoContentCopyrightOwnerId", required = false) String videoContentCopyrightOwnerId) {
LambdaQueryWrapper<Asset> ew = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<Asset> ew = new LambdaQueryWrapper<>();
ew.eq(Asset::getPublished, true); // ew.eq(Asset::getPublished, true);
// 对名称或编码模糊查询 // 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) { String nameOrCode = genericPageParam.getNameOrCode();
ew.like(Asset::getFileName, genericPageParam.getNameOrCode()); if (StringUtils.isBlank(nameOrCode)) {
// ew.like(Asset::getFileName, genericPageParam.getNameOrCode());
nameOrCode = null;
} }
// 设置排序规则 // 设置排序规则
ew.orderByDesc(Asset::getCreateTime); // ew.orderByDesc(Asset::getCreateTime);
Page<Asset> page = this.assetService.pageByConditions(getPage(), videoContentCatId, videoContentCopyrightOwnerId); Page<Asset> page = this.assetService.pageByConditions(getPage(), videoContentCatId, videoContentCopyrightOwnerId,nameOrCode);
return getResult(page); return getResult(page);
} }
......
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