质量宣传图版本查询修改
This commit is contained in:
parent
f96613cdab
commit
0e4d3d7aa8
|
|
@ -1,6 +1,6 @@
|
||||||
package com.nflg.wms.common.pojo.qo;
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -10,12 +10,12 @@ public class AdvertisementRequst {
|
||||||
/**
|
/**
|
||||||
* 广告类型
|
* 广告类型
|
||||||
*/
|
*/
|
||||||
@NotBlank
|
@NotNull
|
||||||
private String type;
|
private Long type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 广告位置
|
* 广告位置
|
||||||
*/
|
*/
|
||||||
@NotBlank
|
@NotNull
|
||||||
private String position;
|
private Long position;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ import java.util.List;
|
||||||
public interface AdvertisementMapper extends BaseMapper<Advertisement> {
|
public interface AdvertisementMapper extends BaseMapper<Advertisement> {
|
||||||
|
|
||||||
|
|
||||||
Advertisement getByType(String type, String position);
|
Advertisement getByType(Long type, Long position);
|
||||||
|
|
||||||
IPage<AdvertisementListVO> getList(IPage<?> page);
|
IPage<AdvertisementListVO> getList(IPage<?> page);
|
||||||
|
|
||||||
List<AdvertisementListVO> getVersions(String type, String position);
|
List<AdvertisementListVO> getVersions(Long type, Long position);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IAdvertisementService extends IService<Advertisement> {
|
public interface IAdvertisementService extends IService<Advertisement> {
|
||||||
|
|
||||||
AdvertisementVO getByType(String type, String position);
|
AdvertisementVO getByType(Long type, Long position);
|
||||||
|
|
||||||
void save(AdvertisementSaveRequest request);
|
void save(AdvertisementSaveRequest request);
|
||||||
|
|
||||||
IPage<AdvertisementListVO> getList(PageQO request);
|
IPage<AdvertisementListVO> getList(PageQO request);
|
||||||
|
|
||||||
List<AdvertisementListVO> getVersions(String type, String position);
|
List<AdvertisementListVO> getVersions(Long type, Long position);
|
||||||
|
|
||||||
void enable(EnableBatchQO request);
|
void enable(EnableBatchQO request);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import java.util.Objects;
|
||||||
public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, Advertisement> implements IAdvertisementService {
|
public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, Advertisement> implements IAdvertisementService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdvertisementVO getByType(String type, String position) {
|
public AdvertisementVO getByType(Long type, Long position) {
|
||||||
Advertisement ad = baseMapper.getByType(type, position);
|
Advertisement ad = baseMapper.getByType(type, position);
|
||||||
if (Objects.isNull(ad)) {
|
if (Objects.isNull(ad)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -76,7 +76,7 @@ public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, A
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdvertisementListVO> getVersions(String type, String position) {
|
public List<AdvertisementListVO> getVersions(Long type, Long position) {
|
||||||
return baseMapper.getVersions(type, position);
|
return baseMapper.getVersions(type, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
<select id="getByType" resultType="com.nflg.wms.repository.entity.Advertisement">
|
<select id="getByType" resultType="com.nflg.wms.repository.entity.Advertisement">
|
||||||
SELECT ad.*
|
SELECT ad.*
|
||||||
FROM qms_advertisement ad
|
FROM qms_advertisement ad
|
||||||
INNER JOIN dictionary_item di1 ON ad.type = di1.id
|
WHERE ad.type = #{type}
|
||||||
INNER JOIN dictionary_item di2 ON ad.position = di2.id
|
AND ad.position = #{position}
|
||||||
where di1.code = #{type} AND di2.code=#{position} and ad.enable
|
AND ad.enable
|
||||||
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC
|
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -38,8 +38,8 @@
|
||||||
FROM qms_advertisement ad
|
FROM qms_advertisement ad
|
||||||
INNER JOIN dictionary_item di1 ON ad.type=di1.id
|
INNER JOIN dictionary_item di1 ON ad.type=di1.id
|
||||||
INNER JOIN dictionary_item di2 ON ad.position=di2.id
|
INNER JOIN dictionary_item di2 ON ad.position=di2.id
|
||||||
WHERE di1.code = #{type}
|
WHERE ad.type = #{type}
|
||||||
AND di2.code = #{position}
|
AND ad.position = #{position}
|
||||||
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC,
|
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC,
|
||||||
ad.create_time DESC,
|
ad.create_time DESC,
|
||||||
ad.id DESC
|
ad.id DESC
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue