质量宣传图版本查询修改

This commit is contained in:
yf001217 2026-06-26 17:27:50 +08:00
parent f96613cdab
commit 0e4d3d7aa8
5 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
package com.nflg.wms.common.pojo.qo;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@ -10,12 +10,12 @@ public class AdvertisementRequst {
/**
* 广告类型
*/
@NotBlank
private String type;
@NotNull
private Long type;
/**
* 广告位置
*/
@NotBlank
private String position;
@NotNull
private Long position;
}

View File

@ -18,9 +18,9 @@ import java.util.List;
public interface AdvertisementMapper extends BaseMapper<Advertisement> {
Advertisement getByType(String type, String position);
Advertisement getByType(Long type, Long position);
IPage<AdvertisementListVO> getList(IPage<?> page);
List<AdvertisementListVO> getVersions(String type, String position);
List<AdvertisementListVO> getVersions(Long type, Long position);
}

View File

@ -21,13 +21,13 @@ import java.util.List;
*/
public interface IAdvertisementService extends IService<Advertisement> {
AdvertisementVO getByType(String type, String position);
AdvertisementVO getByType(Long type, Long position);
void save(AdvertisementSaveRequest request);
IPage<AdvertisementListVO> getList(PageQO request);
List<AdvertisementListVO> getVersions(String type, String position);
List<AdvertisementListVO> getVersions(Long type, Long position);
void enable(EnableBatchQO request);
}

View File

@ -32,7 +32,7 @@ import java.util.Objects;
public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, Advertisement> implements IAdvertisementService {
@Override
public AdvertisementVO getByType(String type, String position) {
public AdvertisementVO getByType(Long type, Long position) {
Advertisement ad = baseMapper.getByType(type, position);
if (Objects.isNull(ad)) {
return null;
@ -76,7 +76,7 @@ public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, A
}
@Override
public List<AdvertisementListVO> getVersions(String type, String position) {
public List<AdvertisementListVO> getVersions(Long type, Long position) {
return baseMapper.getVersions(type, position);
}

View File

@ -5,9 +5,9 @@
<select id="getByType" resultType="com.nflg.wms.repository.entity.Advertisement">
SELECT ad.*
FROM qms_advertisement ad
INNER JOIN dictionary_item di1 ON ad.type = di1.id
INNER JOIN dictionary_item di2 ON ad.position = di2.id
where di1.code = #{type} AND di2.code=#{position} and ad.enable
WHERE ad.type = #{type}
AND ad.position = #{position}
AND ad.enable
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC
LIMIT 1
</select>
@ -38,8 +38,8 @@
FROM qms_advertisement ad
INNER JOIN dictionary_item di1 ON ad.type=di1.id
INNER JOIN dictionary_item di2 ON ad.position=di2.id
WHERE di1.code = #{type}
AND di2.code = #{position}
WHERE ad.type = #{type}
AND ad.position = #{position}
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC,
ad.create_time DESC,
ad.id DESC