记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
c21f48ef
Commit
c21f48ef
authored
Aug 20, 2025
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LostFoundItem
parent
7b423be9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
544 additions
and
5 deletions
+544
-5
SweetLostFoundItemParam.java
...iquidnet/service/sweet/param/SweetLostFoundItemParam.java
+52
-0
ValidationGroups.java
...a/com/liquidnet/service/sweet/param/ValidationGroups.java
+6
-4
ISweetLostFoundItemService.java
...net/service/sweet/service/ISweetLostFoundItemService.java
+59
-0
SweetLostFoundItemVo.java
.../com/liquidnet/service/sweet/vo/SweetLostFoundItemVo.java
+50
-0
SweetLostFoundItem.java
...om/liquidnet/service/sweet/entity/SweetLostFoundItem.java
+128
-0
SweetLostFoundItemMapper.java
...uidnet/service/sweet/mapper/SweetLostFoundItemMapper.java
+14
-0
SweetLostFoundItemMapper.xml
...quidnet.service.sweet.mapper/SweetLostFoundItemMapper.xml
+42
-0
db_sweet_lost_found.sql
...vice/liquidnet-service-sweet/docu/db_sweet_lost_found.sql
+1
-1
SweetLostFoundItemController.java
...ervice/sweet/controller/SweetLostFoundItemController.java
+67
-0
SweetLostFoundItemServiceImpl.java
...ice/sweet/service/impl/SweetLostFoundItemServiceImpl.java
+125
-0
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/param/SweetLostFoundItemParam.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 失物招领信息查询参数
*
* @author liquidnet
* @since 2025-01-18
*/
@Data
@ApiModel
(
"失物招领信息查询参数"
)
public
class
SweetLostFoundItemParam
implements
Serializable
{
@ApiModelProperty
(
"主键ID 编辑填写"
)
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidationGroups
.
Update
.
class
)
private
Long
id
;
@ApiModelProperty
(
"演出ID"
)
@NotBlank
(
message
=
"演出ID不能为空"
)
private
String
performanceId
;
@ApiModelProperty
(
"物品类型:1-证件卡类 2-3C数码类 3-服饰类 4-其他"
)
@NotNull
(
message
=
"物品类型不能为空"
)
private
Integer
itemType
;
@ApiModelProperty
(
"拾捡地:1-音乐节现场 2-其他"
)
@NotNull
(
message
=
"拾捡地不能为空"
)
private
Integer
pickupLocation
;
@ApiModelProperty
(
"捡拾日期"
)
@NotNull
(
message
=
"捡拾日期不能为空"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
pickupDate
;
@ApiModelProperty
(
"物品描述,最多120字"
)
@NotBlank
(
message
=
"物品描述不能为空"
)
private
String
description
;
@ApiModelProperty
(
"物品图片URL"
)
@NotBlank
(
message
=
"物品图片URL不能为空"
)
private
String
itemImage
;
}
\ No newline at end of file
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/param/ValidationGroups.java
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
param
;
package
com
.
liquidnet
.
service
.
sweet
.
param
;
import
javax.validation.groups.Default
;
/**
/**
* <p>
* <p>
* xx 服务实现类
* xx 服务实现类
...
@@ -9,8 +11,8 @@ package com.liquidnet.service.sweet.param;
...
@@ -9,8 +11,8 @@ package com.liquidnet.service.sweet.param;
* @since 2025-08-20 13:13
* @since 2025-08-20 13:13
*/
*/
public
class
ValidationGroups
{
public
class
ValidationGroups
{
public
interface
Create
{}
public
interface
Create
extends
Default
{}
public
interface
Update
{}
public
interface
Update
extends
Default
{}
public
interface
Delete
{}
public
interface
Delete
extends
Default
{}
public
interface
Query
{}
public
interface
Query
extends
Default
{}
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetLostFoundItemService.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.liquidnet.service.sweet.entity.SweetLostFoundItem
;
import
com.liquidnet.service.sweet.param.SweetLostFoundItemParam
;
import
com.liquidnet.service.sweet.vo.SweetLostFoundItemVo
;
import
java.util.List
;
/**
* 失物招领信息服务接口
*
* @author liquidnet
* @since 2025-01-18
*/
public
interface
ISweetLostFoundItemService
extends
IService
<
SweetLostFoundItem
>
{
/**
* 发布失物信息
*
* @param item 失物信息
* @return 是否成功
*/
boolean
publishItem
(
SweetLostFoundItemParam
item
);
/**
* 编辑失物信息
*
* @param item 失物信息
* @return 是否成功
*/
boolean
editItem
(
SweetLostFoundItemParam
item
);
/**
* 删除失物信息
*
* @param id 物品ID
* @return 是否成功
*/
boolean
deleteItem
(
Long
id
);
/**
* 获取失物信息详情
*
* @param id 物品ID
* @return 失物信息详情
*/
SweetLostFoundItemVo
getItemDetail
(
Long
id
);
/**
* 根据演出ID查询失物信息列表
*
* @param itemType 演出ID
* @param performanceId 演出ID
* @return 失物信息列表
*/
List
<
SweetLostFoundItemVo
>
getItemList
(
Integer
itemType
,
String
performanceId
);
}
\ No newline at end of file
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/vo/SweetLostFoundItemVo.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 失物招领信息返回VO
*
* @author liquidnet
* @since 2025-01-18
*/
@Data
@ApiModel
(
"失物招领信息返回"
)
public
class
SweetLostFoundItemVo
{
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
@ApiModelProperty
(
"物品图片URL"
)
private
String
itemImage
;
@ApiModelProperty
(
"物品描述,最多120字"
)
private
String
description
;
@ApiModelProperty
(
"拾捡地:1-音乐节现场 2-其他"
)
private
Integer
pickupLocation
;
@ApiModelProperty
(
"捡拾日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
pickupDate
;
@ApiModelProperty
(
"物品类型:1-证件卡类 2-3C数码类 3-服饰类 4-其他"
)
private
Integer
itemType
;
@ApiModelProperty
(
"演出ID"
)
private
String
performanceId
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
\ No newline at end of file
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetLostFoundItem.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 失物招领信息实体类
*
* @author liquidnet
* @since 2025-01-18
*/
@ApiModel
(
"失物招领信息"
)
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
SweetLostFoundItem
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"主键ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
@ApiModelProperty
(
"失物信息ID"
)
@TableField
(
"item_id"
)
private
String
itemId
;
@ApiModelProperty
(
"物品图片URL"
)
@TableField
(
"item_image"
)
private
String
itemImage
;
@ApiModelProperty
(
"物品描述,最多120字"
)
@TableField
(
"description"
)
private
String
description
;
@ApiModelProperty
(
"拾捡地:1-音乐节现场 2-其他"
)
@TableField
(
"pickup_location"
)
private
Integer
pickupLocation
;
@ApiModelProperty
(
"捡拾日期"
)
@TableField
(
"pickup_date"
)
private
Date
pickupDate
;
@ApiModelProperty
(
"物品类型:1-证件卡类 2-3C数码类 3-服饰类 4-其他"
)
@TableField
(
"item_type"
)
private
Integer
itemType
;
@ApiModelProperty
(
"演出ID"
)
@TableField
(
"performance_id"
)
private
String
performanceId
;
@ApiModelProperty
(
"创建时间"
)
@TableField
(
"create_time"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@TableField
(
"update_time"
)
private
Date
updateTime
;
@ApiModelProperty
(
"是否删除:0-未删除 1-已删除"
)
@TableField
(
"is_deleted"
)
private
Integer
isDeleted
;
private
static
final
SweetLostFoundItem
obj
=
new
SweetLostFoundItem
();
public
static
SweetLostFoundItem
getNew
()
{
try
{
return
(
SweetLostFoundItem
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
SweetLostFoundItem
();
}
}
// 拾捡地枚举
public
enum
PickupLocation
{
FESTIVAL_SITE
(
1
,
"音乐节现场"
),
OTHER_PLACE
(
2
,
"其他"
);
private
final
int
code
;
private
final
String
desc
;
PickupLocation
(
int
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getDesc
()
{
return
desc
;
}
}
// 物品类型枚举
public
enum
ItemType
{
DOCUMENT_CARD
(
1
,
"证件卡类"
),
DIGITAL_DEVICE
(
2
,
"3C数码类"
),
CLOTHING
(
3
,
"服饰类"
),
OTHER
(
4
,
"其他"
);
private
final
int
code
;
private
final
String
desc
;
ItemType
(
int
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getDesc
()
{
return
desc
;
}
}
}
\ No newline at end of file
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/mapper/SweetLostFoundItemMapper.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.liquidnet.service.sweet.entity.SweetLostFoundItem
;
/**
* 失物招领信息Mapper接口
*
* @author liquidnet
* @since 2025-01-18
*/
public
interface
SweetLostFoundItemMapper
extends
BaseMapper
<
SweetLostFoundItem
>
{
}
\ No newline at end of file
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetLostFoundItemMapper.xml
0 → 100644
View file @
c21f48ef
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetLostFoundItemMapper"
>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id
, item_image, description, pickup_location, pickup_date, item_type,
performance_id, create_time, update_time, is_deleted, create_user_id, update_user_id
</sql>
<!-- 查询失物信息列表 -->
<select
id=
"selectItemPage"
resultType=
"com.liquidnet.service.sweet.vo.SweetLostFoundItemVo"
>
SELECT
i.id,
i.item_image,
i.description,
i.pickup_location,
i.pickup_date,
i.item_type,
i.performance_id,
i.create_time,
i.update_time,
i.create_user_id
FROM sweet_lost_found_item i
WHERE i.is_deleted = 0
<if
test=
"param.performanceId != null"
>
AND i.performance_id = #{param.performanceId}
</if>
<if
test=
"param.itemType != null"
>
AND i.item_type = #{param.itemType}
</if>
<if
test=
"param.startDate != null"
>
AND i.pickup_date >= #{param.startDate}
</if>
<if
test=
"param.endDate != null"
>
AND i.pickup_date
<
= #{param.endDate}
</if>
ORDER BY i.create_time DESC
</select>
</mapper>
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-sweet/docu/db_sweet_lost_found.sql
View file @
c21f48ef
...
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `sweet_lost_found_item`
...
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `sweet_lost_found_item`
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`item_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'失物信息ID'
,
`item_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'失物信息ID'
,
`item_image`
varchar
(
500
)
NOT
NULL
DEFAULT
''
COMMENT
'物品图片URL'
,
`item_image`
varchar
(
500
)
NOT
NULL
DEFAULT
''
COMMENT
'物品图片URL'
,
`description`
varchar
(
12
0
)
NOT
NULL
DEFAULT
''
COMMENT
'物品描述,最多120字'
,
`description`
varchar
(
50
0
)
NOT
NULL
DEFAULT
''
COMMENT
'物品描述,最多120字'
,
`pickup_location`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'拾捡地:1-音乐节现场 2-其他'
,
`pickup_location`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'拾捡地:1-音乐节现场 2-其他'
,
`pickup_date`
date
NOT
NULL
COMMENT
'捡拾日期'
,
`pickup_date`
date
NOT
NULL
COMMENT
'捡拾日期'
,
`item_type`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'物品类型:1-证件卡类 2-3C数码类 3-服饰类 4-其他'
,
`item_type`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'物品类型:1-证件卡类 2-3C数码类 3-服饰类 4-其他'
,
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetLostFoundItemController.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.param.SweetLostFoundItemParam
;
import
com.liquidnet.service.sweet.param.ValidationGroups
;
import
com.liquidnet.service.sweet.service.ISweetLostFoundItemService
;
import
com.liquidnet.service.sweet.vo.SweetLostFoundItemVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 失物招领信息Controller
*
* @author liquidnet
* @since 2025-01-18
*/
@RestController
@RequestMapping
(
"/lost-found/item"
)
@Api
(
value
=
"失物招领信息管理"
,
tags
=
"失物招领信息管理"
)
@Validated
public
class
SweetLostFoundItemController
{
@Autowired
private
ISweetLostFoundItemService
sweetLostFoundItemService
;
@PostMapping
(
"/publish"
)
@ApiOperation
(
"发布失物信息"
)
public
ResponseDto
<
Boolean
>
publishItem
(
@RequestBody
@Validated
SweetLostFoundItemParam
item
)
{
return
ResponseDto
.
success
(
sweetLostFoundItemService
.
publishItem
(
item
));
}
@PutMapping
(
"/update"
)
@ApiOperation
(
"编辑失物信息"
)
public
ResponseDto
<
Boolean
>
updateItem
(
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
SweetLostFoundItemParam
item
)
{
return
ResponseDto
.
success
(
sweetLostFoundItemService
.
editItem
(
item
));
}
@DeleteMapping
(
"/delete/{itemId}"
)
@ApiOperation
(
"删除失物信息"
)
public
ResponseDto
<
Boolean
>
deleteItem
(
@ApiParam
(
"失物信息ID"
)
@PathVariable
Long
itemId
)
{
return
ResponseDto
.
success
(
sweetLostFoundItemService
.
deleteItem
(
itemId
));
}
@GetMapping
(
"/detail/{itemId}"
)
@ApiOperation
(
"获取失物信息详情"
)
public
ResponseDto
<
SweetLostFoundItemVo
>
getItemDetail
(
@ApiParam
(
"失物信息ID"
)
@PathVariable
Long
itemId
)
{
return
ResponseDto
.
success
(
sweetLostFoundItemService
.
getItemDetail
(
itemId
));
}
@GetMapping
(
"/list"
)
@ApiOperation
(
"获取失物信息列表"
)
public
ResponseDto
<
List
<
SweetLostFoundItemVo
>>
getItemList
(
@ApiParam
(
"物品类型"
)
@RequestParam
(
required
=
false
)
Integer
itemType
,
@ApiParam
(
"演出ID"
)
@RequestParam
String
performanceId
)
{
return
ResponseDto
.
success
(
sweetLostFoundItemService
.
getItemList
(
itemType
,
performanceId
));
}
}
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetLostFoundItemServiceImpl.java
0 → 100644
View file @
c21f48ef
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.sweet.entity.SweetLostFoundItem
;
import
com.liquidnet.service.sweet.mapper.SweetLostFoundItemMapper
;
import
com.liquidnet.service.sweet.param.SweetLostFoundItemParam
;
import
com.liquidnet.service.sweet.service.ISweetLostFoundItemService
;
import
com.liquidnet.service.sweet.vo.SweetLostFoundItemVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 失物招领信息服务实现类
*
* @author liquidnet
* @since 2025-01-18
*/
@Service
public
class
SweetLostFoundItemServiceImpl
extends
ServiceImpl
<
SweetLostFoundItemMapper
,
SweetLostFoundItem
>
implements
ISweetLostFoundItemService
{
@Override
public
boolean
publishItem
(
SweetLostFoundItemParam
item
)
{
if
(
item
==
null
)
{
return
false
;
}
SweetLostFoundItem
lostFoundItem
=
new
SweetLostFoundItem
();
lostFoundItem
.
setItemId
(
IDGenerator
.
nextSnowId
());
lostFoundItem
.
setPerformanceId
(
item
.
getPerformanceId
());
lostFoundItem
.
setItemType
(
item
.
getItemType
());
lostFoundItem
.
setPickupLocation
(
item
.
getPickupLocation
());
lostFoundItem
.
setPickupDate
(
item
.
getPickupDate
());
lostFoundItem
.
setDescription
(
item
.
getDescription
());
lostFoundItem
.
setItemImage
(
item
.
getItemImage
());
return
baseMapper
.
insert
(
lostFoundItem
)
>
0
;
}
@Override
public
boolean
editItem
(
SweetLostFoundItemParam
item
)
{
if
(
item
==
null
||
item
.
getId
()
==
null
)
{
return
false
;
}
SweetLostFoundItem
existingItem
=
SweetLostFoundItem
.
getNew
();
// 更新实体类字段
existingItem
.
setId
(
item
.
getId
());
existingItem
.
setPerformanceId
(
item
.
getPerformanceId
());
existingItem
.
setItemType
(
item
.
getItemType
());
existingItem
.
setPickupLocation
(
item
.
getPickupLocation
());
existingItem
.
setPickupDate
(
item
.
getPickupDate
());
existingItem
.
setDescription
(
item
.
getDescription
());
existingItem
.
setItemImage
(
item
.
getItemImage
());
return
baseMapper
.
updateById
(
existingItem
)
>
0
;
}
@Override
public
boolean
deleteItem
(
Long
id
)
{
if
(
id
==
null
)
{
return
false
;
}
// 检查物品是否存在
SweetLostFoundItem
item
=
baseMapper
.
selectById
(
id
);
if
(
item
==
null
||
item
.
getIsDeleted
()
==
1
)
{
return
false
;
}
item
.
setIsDeleted
(
1
);
return
baseMapper
.
updateById
(
item
)
>
0
;
}
@Override
public
SweetLostFoundItemVo
getItemDetail
(
Long
id
)
{
if
(
id
==
null
)
{
return
null
;
}
SweetLostFoundItem
item
=
baseMapper
.
selectById
(
id
);
if
(
item
==
null
||
item
.
getIsDeleted
()
==
1
)
{
return
null
;
}
SweetLostFoundItemVo
vo
=
new
SweetLostFoundItemVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
return
vo
;
}
@Override
public
List
<
SweetLostFoundItemVo
>
getItemList
(
Integer
itemType
,
String
performanceId
)
{
QueryWrapper
<
SweetLostFoundItem
>
queryWrapper
=
new
QueryWrapper
<>();
// 过滤逻辑删除的记录
queryWrapper
.
eq
(
"is_deleted"
,
0
);
// 根据演出ID查询
queryWrapper
.
eq
(
"performance_id"
,
performanceId
.
trim
());
// 根据物品类型查询
if
(
itemType
!=
null
)
{
queryWrapper
.
eq
(
"item_type"
,
itemType
);
}
// 排序:按创建时间降序排列
queryWrapper
.
orderByDesc
(
"create_time"
);
// 执行查询
List
<
SweetLostFoundItem
>
items
=
baseMapper
.
selectList
(
queryWrapper
);
// 转换为VO对象列表
return
items
.
stream
()
.
map
(
item
->
{
SweetLostFoundItemVo
vo
=
new
SweetLostFoundItemVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
return
vo
;
})
.
collect
(
Collectors
.
toList
());
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment