Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
38925589
Commit
38925589
authored
Oct 12, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mybatis-plus 优化;
优惠券领取记录; 门店包厢管理优化;
parent
0e2c3755
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
882 additions
and
66 deletions
+882
-66
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+104
-0
SConsumptionRecordsController.java
.../web/controller/system/SConsumptionRecordsController.java
+1
-1
SCouponController.java
...n/java/share/web/controller/system/SCouponController.java
+1
-1
SRoomController.java
...ain/java/share/web/controller/system/SRoomController.java
+4
-3
STimeSlotController.java
...java/share/web/controller/system/STimeSlotController.java
+1
-1
pom.xml
share-common/pom.xml
+6
-0
BaseEntity.java
...on/src/main/java/share/common/core/domain/BaseEntity.java
+4
-0
MyBatisConfig.java
...k/src/main/java/share/framework/config/MyBatisConfig.java
+4
-1
generator.yml
share-generator/src/main/resources/generator.yml
+1
-1
controller.java.vm
...e-generator/src/main/resources/vm/java/controller.java.vm
+1
-1
domain.java.vm
share-generator/src/main/resources/vm/java/domain.java.vm
+26
-19
mapper.java.vm
share-generator/src/main/resources/vm/java/mapper.java.vm
+2
-1
service.java.vm
share-generator/src/main/resources/vm/java/service.java.vm
+2
-1
serviceImpl.java.vm
...-generator/src/main/resources/vm/java/serviceImpl.java.vm
+2
-1
pom.xml
share-system/pom.xml
+20
-1
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+135
-0
SRoom.java
share-system/src/main/java/share/system/domain/SRoom.java
+1
-15
SStore.java
share-system/src/main/java/share/system/domain/SStore.java
+1
-0
SRoomVo.java
...-system/src/main/java/share/system/domain/vo/SRoomVo.java
+106
-0
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+62
-0
SStoreMapper.java
...ystem/src/main/java/share/system/mapper/SStoreMapper.java
+3
-1
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+62
-0
ISRoomService.java
...tem/src/main/java/share/system/service/ISRoomService.java
+3
-2
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+10
-1
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+97
-0
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+41
-4
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+17
-3
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+162
-0
SRoomMapper.xml
...e-system/src/main/resources/mapper/system/SRoomMapper.xml
+3
-8
No files found.
share-admin/src/main/java/share/web/controller/system/SConsumerCouponController.java
0 → 100644
View file @
38925589
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.service.ISConsumerCouponService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
/**
* 优惠券领取记录Controller
*
* @author wuwenlong
* @date 2023-10-12
*/
@RestController
@RequestMapping
(
"/system/coupon"
)
public
class
SConsumerCouponController
extends
BaseController
{
@Autowired
private
ISConsumerCouponService
sConsumerCouponService
;
/**
* 查询优惠券领取记录列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SConsumerCoupon
sConsumerCoupon
)
{
startPage
();
List
<
SConsumerCoupon
>
list
=
sConsumerCouponService
.
selectSConsumerCouponList
(
sConsumerCoupon
);
return
getDataTable
(
list
);
}
/**
* 导出优惠券领取记录列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:export')"
)
@Log
(
title
=
"优惠券领取记录"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SConsumerCoupon
sConsumerCoupon
)
{
List
<
SConsumerCoupon
>
list
=
sConsumerCouponService
.
selectSConsumerCouponList
(
sConsumerCoupon
);
ExcelUtil
<
SConsumerCoupon
>
util
=
new
ExcelUtil
<
SConsumerCoupon
>(
SConsumerCoupon
.
class
);
util
.
exportExcel
(
response
,
list
,
"优惠券领取记录数据"
);
}
/**
* 获取优惠券领取记录详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
sConsumerCouponService
.
selectSConsumerCouponById
(
id
));
}
/**
* 新增优惠券领取记录
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:add')"
)
@Log
(
title
=
"优惠券领取记录"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
SConsumerCoupon
sConsumerCoupon
)
{
return
toAjax
(
sConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
));
}
/**
* 修改优惠券领取记录
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:edit')"
)
@Log
(
title
=
"优惠券领取记录"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SConsumerCoupon
sConsumerCoupon
)
{
return
toAjax
(
sConsumerCouponService
.
updateSConsumerCoupon
(
sConsumerCoupon
));
}
/**
* 删除优惠券领取记录
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:remove')"
)
@Log
(
title
=
"优惠券领取记录"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
sConsumerCouponService
.
deleteSConsumerCouponByIds
(
ids
));
}
}
share-admin/src/main/java/share/web/controller/system/SConsumptionRecordsController.java
View file @
38925589
package
share
.
web
.
system
.
controller
;
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
...
...
share-admin/src/main/java/share/web/controller/system/SCouponController.java
View file @
38925589
package
share
.
web
.
system
.
controller
;
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
...
...
share-admin/src/main/java/share/web/controller/system/SRoomController.java
View file @
38925589
...
...
@@ -17,6 +17,7 @@ import share.common.core.controller.BaseController;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.system.domain.SRoom
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.service.ISRoomService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
...
...
@@ -42,7 +43,7 @@ public class SRoomController extends BaseController
public
TableDataInfo
list
(
SRoom
sRoom
)
{
startPage
();
List
<
SRoom
>
list
=
sRoomService
.
selectSRoomList
(
sRoom
);
List
<
SRoom
Vo
>
list
=
sRoomService
.
selectSRoomList
(
sRoom
);
return
getDataTable
(
list
);
}
...
...
@@ -54,8 +55,8 @@ public class SRoomController extends BaseController
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SRoom
sRoom
)
{
List
<
SRoom
>
list
=
sRoomService
.
selectSRoomList
(
sRoom
);
ExcelUtil
<
SRoom
>
util
=
new
ExcelUtil
<
SRoom
>(
SRoom
.
class
);
List
<
SRoom
Vo
>
list
=
sRoomService
.
selectSRoomList
(
sRoom
);
ExcelUtil
<
SRoom
Vo
>
util
=
new
ExcelUtil
<
SRoomVo
>(
SRoomVo
.
class
);
util
.
exportExcel
(
response
,
list
,
"房间数据"
);
}
...
...
share-admin/src/main/java/share/web/controller/system/STimeSlotController.java
View file @
38925589
package
share
.
web
.
system
.
controller
;
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
...
...
share-common/pom.xml
View file @
38925589
...
...
@@ -125,6 +125,12 @@
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-annotation
</artifactId>
<version>
3.3.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
...
...
share-common/src/main/java/share/common/core/domain/BaseEntity.java
View file @
38925589
...
...
@@ -4,6 +4,8 @@ import java.io.Serializable;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
...
...
@@ -19,6 +21,7 @@ public class BaseEntity implements Serializable
/** 搜索值 */
@JsonIgnore
@TableField
(
exist
=
false
)
private
String
searchValue
;
/** 创建者 */
...
...
@@ -40,6 +43,7 @@ public class BaseEntity implements Serializable
/** 请求参数 */
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
@TableField
(
exist
=
false
)
private
Map
<
String
,
Object
>
params
;
public
String
getSearchValue
()
...
...
share-framework/src/main/java/share/framework/config/MyBatisConfig.java
View file @
38925589
...
...
@@ -6,6 +6,8 @@ import java.util.Arrays;
import
java.util.HashSet
;
import
java.util.List
;
import
javax.sql.DataSource
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
org.apache.ibatis.io.VFS
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
...
...
@@ -122,7 +124,8 @@ public class MyBatisConfig
typeAliasesPackage
=
setTypeAliasesPackage
(
typeAliasesPackage
);
VFS
.
addImplClass
(
SpringBootVFS
.
class
);
final
SqlSessionFactoryBean
sessionFactory
=
new
SqlSessionFactoryBean
();
// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
MybatisSqlSessionFactoryBean
sessionFactory
=
new
MybatisSqlSessionFactoryBean
();
sessionFactory
.
setDataSource
(
dataSource
);
sessionFactory
.
setTypeAliasesPackage
(
typeAliasesPackage
);
sessionFactory
.
setMapperLocations
(
resolveMapperLocations
(
StringUtils
.
split
(
mapperLocations
,
","
)));
...
...
share-generator/src/main/resources/generator.yml
View file @
38925589
# 代码生成
gen
:
# 作者
author
:
ruoyi
author
:
wuwenlong
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName
:
share.system
# 自动去除表前缀,默认是false
...
...
share-generator/src/main/resources/vm/java/controller.java.vm
View file @
38925589
package
${
packageName
}.
controller
;
package
share
.
web
.
controller
.
system
;
import
java
.
util
.
List
;
import
javax
.
servlet
.
http
.
HttpServletResponse
;
...
...
share-generator/src/main/resources/vm/java/domain.java.vm
View file @
38925589
...
...
@@ -11,7 +11,9 @@ import share.common.core.domain.BaseEntity;
#
elseif
($
table
.
tree
)
import
share
.
common
.
core
.
domain
.
TreeEntity
;
#
end
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableField
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableLogic
;
import
lombok
.
Data
;
/**
*
${
functionName
}
对象
${
tableName
}
*
...
...
@@ -23,6 +25,7 @@ import share.common.core.domain.TreeEntity;
#
elseif
($
table
.
tree
)
#
set
($
Entity
=
"TreeEntity"
)
#
end
@
Data
public
class
${
ClassName
}
extends
${
Entity
}
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -42,6 +45,10 @@ public class ${ClassName} extends ${Entity}
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
#
elseif
($
column
.
javaField
==
'isDelete'
)
//
逻辑删除注解
(
0
未删除
1
已删除
)
@
TableLogic
@
TableField
(
select
=
false
)
#
else
@
Excel
(
name
=
"${comment}"
)
#
end
...
...
@@ -55,24 +62,24 @@ public class ${ClassName} extends ${Entity}
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
#
if
($
column
.
javaField
.
length
()
>
2
&&
$
column
.
javaField
.
substring
(
1
,
2
).
matches
(
"[A-Z]"
))
#
set
($
AttrName
=$
column
.
javaField
)
#
else
#
set
($
AttrName
=$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
#
end
public
void
set
${
AttrName
}($
column
.
javaType
$
column
.
javaField
)
{
this
.$
column
.
javaField
=
$
column
.
javaField
;
}
public
$
column
.
javaType
get
${
AttrName
}()
{
return
$
column
.
javaField
;
}
#
end
#
end
#
##
foreach
($
column
in
$
columns
)
#
##
if
(
!$table.isSuperColumn($column.javaField))
#
##
if
($
column
.
javaField
.
length
()
>
2
&&
$
column
.
javaField
.
substring
(
1
,
2
).
matches
(
"[A-Z]"
))
#
##
set
($
AttrName
=$
column
.
javaField
)
#
##
else
#
##
set
($
AttrName
=$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
#
##
end
##
public
void
set
${
AttrName
}($
column
.
javaType
$
column
.
javaField
)
##
{
##
this
.$
column
.
javaField
=
$
column
.
javaField
;
##
}
##
##
public
$
column
.
javaType
get
${
AttrName
}()
##
{
##
return
$
column
.
javaField
;
##
}
#
##
end
#
##
end
#
if
($
table
.
sub
)
public
List
<${
subClassName
}>
get
${
subClassName
}
List
()
...
...
share-generator/src/main/resources/vm/java/mapper.java.vm
View file @
38925589
package
${
packageName
}.
mapper
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
;
import
${
packageName
}.
domain
.${
ClassName
};
#
if
($
table
.
sub
)
import
${
packageName
}.
domain
.${
subClassName
};
...
...
@@ -12,7 +13,7 @@ import ${packageName}.domain.${subClassName};
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
public
interface
${
ClassName
}
Mapper
public
interface
${
ClassName
}
Mapper
extends
BaseMapper
<${
ClassName
}>
{
/**
*
查询
${
functionName
}
...
...
share-generator/src/main/resources/vm/java/service.java.vm
View file @
38925589
package
${
packageName
}.
service
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
IService
;
import
${
packageName
}.
domain
.${
ClassName
};
/**
...
...
@@ -9,7 +10,7 @@ import ${packageName}.domain.${ClassName};
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
public
interface
I
${
ClassName
}
Service
public
interface
I
${
ClassName
}
Service
extends
IService
<${
ClassName
}>
{
/**
*
查询
${
functionName
}
...
...
share-generator/src/main/resources/vm/java/serviceImpl.java.vm
View file @
38925589
package
${
packageName
}.
service
.
impl
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
impl
.
ServiceImpl
;
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
javaField
==
'createTime'
||
$
column
.
javaField
==
'updateTime'
)
import
share
.
common
.
utils
.
DateUtils
;
...
...
@@ -26,7 +27,7 @@ import ${packageName}.service.I${ClassName}Service;
*
@
date
${
datetime
}
*/
@
Service
public
class
${
ClassName
}
ServiceImpl
implements
I
${
ClassName
}
Service
public
class
${
ClassName
}
ServiceImpl
extends
ServiceImpl
<${
ClassName
}
Mapper
,
${
ClassName
}>
implements
I
${
ClassName
}
Service
{
@
Autowired
private
${
ClassName
}
Mapper
${
className
}
Mapper
;
...
...
share-system/pom.xml
View file @
38925589
...
...
@@ -22,7 +22,25 @@
<groupId>
share
</groupId>
<artifactId>
share-common
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-core
</artifactId>
<version>
3.3.1
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-extension
</artifactId>
<version>
3.3.1
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.3.1
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
0 → 100644
View file @
38925589
package
share
.
system
.
domain
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Data
;
/**
* 优惠券领取记录对象 s_consumer_coupon
*
* @author wuwenlong
* @date 2023-10-12
*/
@Data
public
class
SConsumerCoupon
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** ID */
private
Long
id
;
/** 用户ID */
@Excel
(
name
=
"用户ID"
)
private
Long
consumerId
;
/** 优惠券ID */
@Excel
(
name
=
"优惠券ID"
)
private
Long
couponId
;
/** 优惠券编码 */
@Excel
(
name
=
"优惠券编码"
)
private
String
couponCode
;
/** 优惠券名称 */
@Excel
(
name
=
"优惠券名称"
)
private
String
name
;
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */
@Excel
(
name
=
"优惠券类型(1:折扣券,2,满减券,3:时长券)"
)
private
String
couponType
;
/** 折扣最大时长 */
@Excel
(
name
=
"折扣最大时长"
)
private
String
maxDuration
;
/** 时长 */
@Excel
(
name
=
"时长"
)
private
String
duration
;
/** 门槛金额 */
@Excel
(
name
=
"门槛金额"
)
private
BigDecimal
minPrice
;
/** 减去金额(满减券单位:元,折扣为系数) */
@Excel
(
name
=
"减去金额(满减券单位:元,折扣为系数)"
)
private
BigDecimal
subPrice
;
/** 优惠券来源(1:领取,2:赠送,3:验券) */
@Excel
(
name
=
"优惠券来源(1:领取,2:赠送,3:验券)"
)
private
String
sourceType
;
/** 平台类型(1:自营,2:美团) */
@Excel
(
name
=
"平台类型(1:自营,2:美团)"
)
private
String
platformType
;
/** 有效期开始 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"有效期开始"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
startDate
;
/** 有效期结束 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"有效期结束"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
endDate
;
/** 使用时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"使用时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
useDate
;
/** 使用状态(0:待使用,1:已使用,2:已失效) */
@Excel
(
name
=
"使用状态(0:待使用,1:已使用,2:已失效)"
)
private
String
useStatus
;
/** 删除状态(0:未删除,1:已删除) */
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField
(
select
=
false
)
private
Integer
isDelete
;
/** 更新者 */
@Excel
(
name
=
"更新者"
)
private
String
deleteBy
;
/** 更新时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"更新时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
deleteTime
;
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"consumerId"
,
getConsumerId
())
.
append
(
"couponId"
,
getCouponId
())
.
append
(
"couponCode"
,
getCouponCode
())
.
append
(
"name"
,
getName
())
.
append
(
"couponType"
,
getCouponType
())
.
append
(
"maxDuration"
,
getMaxDuration
())
.
append
(
"duration"
,
getDuration
())
.
append
(
"minPrice"
,
getMinPrice
())
.
append
(
"subPrice"
,
getSubPrice
())
.
append
(
"sourceType"
,
getSourceType
())
.
append
(
"platformType"
,
getPlatformType
())
.
append
(
"startDate"
,
getStartDate
())
.
append
(
"endDate"
,
getEndDate
())
.
append
(
"useDate"
,
getUseDate
())
.
append
(
"useStatus"
,
getUseStatus
())
.
append
(
"isDelete"
,
getIsDelete
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"deleteBy"
,
getDeleteBy
())
.
append
(
"deleteTime"
,
getDeleteTime
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
share-system/src/main/java/share/system/domain/SRoom.java
View file @
38925589
...
...
@@ -9,7 +9,7 @@ import share.common.core.domain.BaseEntity;
* 房间对象 s_room
*
* @author ruoyi
* @date 2023-
09-27
* @date 2023-
10-12
*/
public
class
SRoom
extends
BaseEntity
{
...
...
@@ -22,10 +22,6 @@ public class SRoom extends BaseEntity
@Excel
(
name
=
"门店ID"
)
private
Long
storeId
;
/** 所属门店 */
@Excel
(
name
=
"所属门店"
)
private
String
storeName
;
/** 房间名称 */
@Excel
(
name
=
"房间名称"
)
private
String
name
;
...
...
@@ -92,15 +88,6 @@ public class SRoom extends BaseEntity
{
return
storeId
;
}
public
void
setStoreName
(
String
storeName
)
{
this
.
storeName
=
storeName
;
}
public
String
getStoreName
()
{
return
storeName
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
...
...
@@ -215,7 +202,6 @@ public class SRoom extends BaseEntity
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"storeId"
,
getStoreId
())
.
append
(
"storeName"
,
getStoreName
())
.
append
(
"name"
,
getName
())
.
append
(
"roomType"
,
getRoomType
())
.
append
(
"images"
,
getImages
())
...
...
share-system/src/main/java/share/system/domain/SStore.java
View file @
38925589
package
share
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
...
...
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
0 → 100644
View file @
38925589
package
share
.
system
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
/**
* 房间对象 s_room
*
* @author ruoyi
* @date 2023-10-12
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
@Data
public
class
SRoomVo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 房间ID */
private
Long
id
;
/** 门店ID */
@Excel
(
name
=
"门店ID"
)
private
Long
storeId
;
/** 门店名称 */
@Excel
(
name
=
"门店名称"
)
private
String
storeName
;
/** 房间名称 */
@Excel
(
name
=
"房间名称"
)
private
String
name
;
/** 房间类型(中、大、豪华包) */
@Excel
(
name
=
"房间类型(中、大、豪华包)"
)
private
String
roomType
;
/** 房间主图 */
@Excel
(
name
=
"房间主图"
)
private
String
images
;
/** 房间设施(空调、外窗、沙发、茶几、、、) */
@Excel
(
name
=
"房间设施(空调、外窗、沙发、茶几、、、)"
)
private
String
facilities
;
/** 房间详情介绍 */
@Excel
(
name
=
"房间详情介绍"
)
private
String
info
;
/** 房间状态(空闲、保洁中、使用中、维护中) */
@Excel
(
name
=
"房间状态(空闲、保洁中、使用中、维护中)"
)
private
String
status
;
/** 房间单价(默认单位:元/小时) */
@Excel
(
name
=
"房间单价(默认单位:元/小时)"
)
private
Integer
price
;
/** 门锁编码(接入第三方使用) */
@Excel
(
name
=
"门锁编码(接入第三方使用)"
)
private
String
doorLockCode
;
/** 电控控制(接入第三方使用) */
@Excel
(
name
=
"电控控制(接入第三方使用)"
)
private
String
electricControlCode
;
/** 门禁密码(多人可设置多个) */
@Excel
(
name
=
"门禁密码(多人可设置多个)"
)
private
String
password
;
/** 其他可能硬件接入参数(备用1) */
@Excel
(
name
=
"其他可能硬件接入参数(备用1)"
)
private
String
params1
;
/** 其他可能硬件接入参数(备用2) */
@Excel
(
name
=
"其他可能硬件接入参数(备用2)"
)
private
String
params2
;
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"storeId"
,
getStoreId
())
.
append
(
"storeName"
,
getStoreName
())
.
append
(
"name"
,
getName
())
.
append
(
"roomType"
,
getRoomType
())
.
append
(
"images"
,
getImages
())
.
append
(
"facilities"
,
getFacilities
())
.
append
(
"info"
,
getInfo
())
.
append
(
"status"
,
getStatus
())
.
append
(
"price"
,
getPrice
())
.
append
(
"doorLockCode"
,
getDoorLockCode
())
.
append
(
"electricControlCode"
,
getElectricControlCode
())
.
append
(
"password"
,
getPassword
())
.
append
(
"params1"
,
getParams1
())
.
append
(
"params2"
,
getParams2
())
.
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
0 → 100644
View file @
38925589
package
share
.
system
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.SConsumerCoupon
;
/**
* 优惠券领取记录Mapper接口
*
* @author wuwenlong
* @date 2023-10-12
*/
public
interface
SConsumerCouponMapper
extends
BaseMapper
<
SConsumerCoupon
>
{
/**
* 查询优惠券领取记录
*
* @param id 优惠券领取记录主键
* @return 优惠券领取记录
*/
public
SConsumerCoupon
selectSConsumerCouponById
(
Long
id
);
/**
* 查询优惠券领取记录列表
*
* @param sConsumerCoupon 优惠券领取记录
* @return 优惠券领取记录集合
*/
public
List
<
SConsumerCoupon
>
selectSConsumerCouponList
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 新增优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
public
int
insertSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 修改优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
public
int
updateSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 删除优惠券领取记录
*
* @param id 优惠券领取记录主键
* @return 结果
*/
public
int
deleteSConsumerCouponById
(
Long
id
);
/**
* 批量删除优惠券领取记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
}
share-system/src/main/java/share/system/mapper/SStoreMapper.java
View file @
38925589
package
share
.
system
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.SStore
;
/**
...
...
@@ -9,7 +11,7 @@ import share.system.domain.SStore;
* @author ruoyi
* @date 2023-10-11
*/
public
interface
SStoreMapper
public
interface
SStoreMapper
extends
BaseMapper
<
SStore
>
{
/**
* 查询门店
...
...
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
0 → 100644
View file @
38925589
package
share
.
system
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SConsumerCoupon
;
/**
* 优惠券领取记录Service接口
*
* @author wuwenlong
* @date 2023-10-12
*/
public
interface
ISConsumerCouponService
extends
IService
<
SConsumerCoupon
>
{
/**
* 查询优惠券领取记录
*
* @param id 优惠券领取记录主键
* @return 优惠券领取记录
*/
public
SConsumerCoupon
selectSConsumerCouponById
(
Long
id
);
/**
* 查询优惠券领取记录列表
*
* @param sConsumerCoupon 优惠券领取记录
* @return 优惠券领取记录集合
*/
public
List
<
SConsumerCoupon
>
selectSConsumerCouponList
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 新增优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
public
int
insertSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 修改优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
public
int
updateSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
);
/**
* 批量删除优惠券领取记录
*
* @param ids 需要删除的优惠券领取记录主键集合
* @return 结果
*/
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
/**
* 删除优惠券领取记录信息
*
* @param id 优惠券领取记录主键
* @return 结果
*/
public
int
deleteSConsumerCouponById
(
Long
id
);
}
share-system/src/main/java/share/system/service/ISRoomService.java
View file @
38925589
...
...
@@ -2,6 +2,7 @@ package share.system.service;
import
java.util.List
;
import
share.system.domain.SRoom
;
import
share.system.domain.vo.SRoomVo
;
/**
* 房间Service接口
...
...
@@ -17,7 +18,7 @@ public interface ISRoomService
* @param id 房间主键
* @return 房间
*/
public
SRoom
selectSRoomById
(
Long
id
);
public
SRoom
Vo
selectSRoomById
(
Long
id
);
/**
* 查询房间列表
...
...
@@ -25,7 +26,7 @@ public interface ISRoomService
* @param sRoom 房间
* @return 房间集合
*/
public
List
<
SRoom
>
selectSRoomList
(
SRoom
sRoom
);
public
List
<
SRoom
Vo
>
selectSRoomList
(
SRoom
sRoom
);
/**
* 新增房间
...
...
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
38925589
...
...
@@ -3,6 +3,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SStore
;
/**
...
...
@@ -11,7 +12,7 @@ import share.system.domain.SStore;
* @author ruoyi
* @date 2023-10-11
*/
public
interface
ISStoreService
public
interface
ISStoreService
extends
IService
<
SStore
>
{
/**
* 查询门店
...
...
@@ -68,4 +69,12 @@ public interface ISStoreService
* @return 门店集合
*/
public
List
<
Map
>
optionList
(
SStore
sStore
);
/**
* 通过ids查询门店下拉列表
*
* @param ids 门店
* @return 门店集合
*/
public
List
<
Map
>
optionList
(
List
<
Long
>
ids
);
}
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
0 → 100644
View file @
38925589
package
share
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.mapper.SConsumerCouponMapper
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.service.ISConsumerCouponService
;
/**
* 优惠券领取记录Service业务层处理
*
* @author wuwenlong
* @date 2023-10-12
*/
@Service
public
class
SConsumerCouponServiceImpl
extends
ServiceImpl
<
SConsumerCouponMapper
,
SConsumerCoupon
>
implements
ISConsumerCouponService
{
@Autowired
private
SConsumerCouponMapper
sConsumerCouponMapper
;
/**
* 查询优惠券领取记录
*
* @param id 优惠券领取记录主键
* @return 优惠券领取记录
*/
@Override
public
SConsumerCoupon
selectSConsumerCouponById
(
Long
id
)
{
return
sConsumerCouponMapper
.
selectSConsumerCouponById
(
id
);
}
/**
* 查询优惠券领取记录列表
*
* @param sConsumerCoupon 优惠券领取记录
* @return 优惠券领取记录
*/
@Override
public
List
<
SConsumerCoupon
>
selectSConsumerCouponList
(
SConsumerCoupon
sConsumerCoupon
)
{
return
sConsumerCouponMapper
.
selectSConsumerCouponList
(
sConsumerCoupon
);
}
/**
* 新增优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
@Override
public
int
insertSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
)
{
sConsumerCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
sConsumerCouponMapper
.
insertSConsumerCoupon
(
sConsumerCoupon
);
}
/**
* 修改优惠券领取记录
*
* @param sConsumerCoupon 优惠券领取记录
* @return 结果
*/
@Override
public
int
updateSConsumerCoupon
(
SConsumerCoupon
sConsumerCoupon
)
{
sConsumerCoupon
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
sConsumerCouponMapper
.
updateSConsumerCoupon
(
sConsumerCoupon
);
}
/**
* 批量删除优惠券领取记录
*
* @param ids 需要删除的优惠券领取记录主键
* @return 结果
*/
@Override
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
)
{
return
sConsumerCouponMapper
.
deleteSConsumerCouponByIds
(
ids
);
}
/**
* 删除优惠券领取记录信息
*
* @param id 优惠券领取记录主键
* @return 结果
*/
@Override
public
int
deleteSConsumerCouponById
(
Long
id
)
{
return
sConsumerCouponMapper
.
deleteSConsumerCouponById
(
id
);
}
}
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
38925589
package
share
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SStore
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.mapper.SRoomMapper
;
import
share.system.domain.SRoom
;
import
share.system.service.ISRoomService
;
import
share.system.service.ISStoreService
;
/**
* 房间Service业务层处理
...
...
@@ -20,6 +30,9 @@ public class SRoomServiceImpl implements ISRoomService
@Autowired
private
SRoomMapper
sRoomMapper
;
@Autowired
private
ISStoreService
sStoreService
;
/**
* 查询房间
*
...
...
@@ -27,9 +40,13 @@ public class SRoomServiceImpl implements ISRoomService
* @return 房间
*/
@Override
public
SRoom
selectSRoomById
(
Long
id
)
public
SRoom
Vo
selectSRoomById
(
Long
id
)
{
return
sRoomMapper
.
selectSRoomById
(
id
);
SRoom
sRoom
=
sRoomMapper
.
selectSRoomById
(
id
);
if
(
Objects
.
nonNull
(
sRoom
)&&
sRoom
.
getId
()!=
null
){
return
convertVoList
(
new
ArrayList
<
SRoom
>(){{
add
(
sRoom
);}}).
get
(
0
);
}
return
new
SRoomVo
();
}
/**
...
...
@@ -39,9 +56,29 @@ public class SRoomServiceImpl implements ISRoomService
* @return 房间
*/
@Override
public
List
<
SRoom
>
selectSRoomList
(
SRoom
sRoom
)
public
List
<
SRoom
Vo
>
selectSRoomList
(
SRoom
sRoom
)
{
return
sRoomMapper
.
selectSRoomList
(
sRoom
);
List
<
SRoom
>
roomList
=
sRoomMapper
.
selectSRoomList
(
sRoom
);
return
convertVoList
(
roomList
);
}
private
List
<
SRoomVo
>
convertVoList
(
List
<
SRoom
>
roomList
){
List
<
SRoomVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
List
<
Long
>
storeIds
=
roomList
.
stream
().
map
(
SRoom:
:
getStoreId
).
collect
(
Collectors
.
toList
());
List
<
Map
>
storeList
=
sStoreService
.
optionList
(
storeIds
);
roomList
.
stream
().
forEach
(
sRoom
->
{
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
storeList
.
stream
().
forEach
(
store
->
{
if
(
vo
.
getStoreId
().
compareTo
(
Long
.
parseLong
(
store
.
get
(
"id"
).
toString
()))
==
0
){
vo
.
setStoreName
(
store
.
getOrDefault
(
"name"
,
""
).
toString
());
}
});
voList
.
add
(
vo
);
});
}
return
voList
;
}
/**
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
38925589
...
...
@@ -6,6 +6,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -21,7 +22,7 @@ import share.system.service.ISStoreService;
* @date 2023-10-11
*/
@Service
public
class
SStoreServiceImpl
implements
ISStoreService
public
class
SStoreServiceImpl
extends
ServiceImpl
<
SStoreMapper
,
SStore
>
implements
ISStoreService
{
@Autowired
private
SStoreMapper
sStoreMapper
;
...
...
@@ -103,15 +104,28 @@ public class SStoreServiceImpl implements ISStoreService
@Override
public
List
<
Map
>
optionList
(
SStore
sStore
)
{
List
<
SStore
>
storeList
=
sStoreMapper
.
selectSStoreList
(
sStore
);
return
convertOptionList
(
storeList
);
}
@Override
public
List
<
Map
>
optionList
(
List
<
Long
>
ids
)
{
List
<
SStore
>
storeList
=
sStoreMapper
.
selectBatchIds
(
ids
);
return
convertOptionList
(
storeList
);
}
private
List
<
Map
>
convertOptionList
(
List
<
SStore
>
storeList
){
List
<
Map
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
storeList
))
{
result
=
storeList
.
stream
().
map
(
store
->
{
Map
<
Long
,
String
>
map
=
new
HashMap
<
Long
,
String
>()
{{
put
(
store
.
getId
(),
store
.
getName
());
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>()
{{
put
(
"id"
,
store
.
getId
());
put
(
"name"
,
store
.
getName
());
put
(
"storeType"
,
store
.
getStoreType
());
}};
return
map
;
}).
collect
(
Collectors
.
toList
());
}
return
result
;
}
}
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
0 → 100644
View file @
38925589
<?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=
"share.system.mapper.SConsumerCouponMapper"
>
<resultMap
type=
"SConsumerCoupon"
id=
"SConsumerCouponResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"consumerId"
column=
"consumer_id"
/>
<result
property=
"couponId"
column=
"coupon_id"
/>
<result
property=
"couponCode"
column=
"coupon_code"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"couponType"
column=
"coupon_type"
/>
<result
property=
"maxDuration"
column=
"max_duration"
/>
<result
property=
"duration"
column=
"duration"
/>
<result
property=
"minPrice"
column=
"min_price"
/>
<result
property=
"subPrice"
column=
"sub_price"
/>
<result
property=
"sourceType"
column=
"source_type"
/>
<result
property=
"platformType"
column=
"platform_type"
/>
<result
property=
"startDate"
column=
"start_date"
/>
<result
property=
"endDate"
column=
"end_date"
/>
<result
property=
"useDate"
column=
"use_date"
/>
<result
property=
"useStatus"
column=
"use_status"
/>
<result
property=
"isDelete"
column=
"is_delete"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"deleteBy"
column=
"delete_by"
/>
<result
property=
"deleteTime"
column=
"delete_time"
/>
<result
property=
"remark"
column=
"remark"
/>
</resultMap>
<sql
id=
"selectSConsumerCouponVo"
>
select id, consumer_id, coupon_id, coupon_code, name, coupon_type, max_duration, duration, min_price, sub_price, source_type, platform_type, start_date, end_date, use_date, use_status, is_delete, create_by, create_time, update_by, update_time, delete_by, delete_time, remark from s_consumer_coupon
</sql>
<select
id=
"selectSConsumerCouponList"
parameterType=
"SConsumerCoupon"
resultMap=
"SConsumerCouponResult"
>
<include
refid=
"selectSConsumerCouponVo"
/>
<where>
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
<if
test=
"couponId != null "
>
and coupon_id = #{couponId}
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
and coupon_code = #{couponCode}
</if>
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
<if
test=
"couponType != null and couponType != ''"
>
and coupon_type = #{couponType}
</if>
<if
test=
"maxDuration != null and maxDuration != ''"
>
and max_duration = #{maxDuration}
</if>
<if
test=
"duration != null and duration != ''"
>
and duration = #{duration}
</if>
<if
test=
"minPrice != null "
>
and min_price = #{minPrice}
</if>
<if
test=
"subPrice != null "
>
and sub_price = #{subPrice}
</if>
<if
test=
"sourceType != null and sourceType != ''"
>
and source_type = #{sourceType}
</if>
<if
test=
"platformType != null and platformType != ''"
>
and platform_type = #{platformType}
</if>
<if
test=
"startDate != null "
>
and start_date = #{startDate}
</if>
<if
test=
"endDate != null "
>
and end_date = #{endDate}
</if>
<if
test=
"useDate != null "
>
and use_date = #{useDate}
</if>
<if
test=
"useStatus != null and useStatus != ''"
>
and use_status = #{useStatus}
</if>
<if
test=
"isDelete != null "
>
and is_delete = #{isDelete}
</if>
<if
test=
"deleteBy != null and deleteBy != ''"
>
and delete_by = #{deleteBy}
</if>
<if
test=
"deleteTime != null "
>
and delete_time = #{deleteTime}
</if>
</where>
</select>
<select
id=
"selectSConsumerCouponById"
parameterType=
"Long"
resultMap=
"SConsumerCouponResult"
>
<include
refid=
"selectSConsumerCouponVo"
/>
where id = #{id}
</select>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_coupon
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"consumerId != null"
>
consumer_id,
</if>
<if
test=
"couponId != null"
>
coupon_id,
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code,
</if>
<if
test=
"name != null and name != ''"
>
name,
</if>
<if
test=
"couponType != null"
>
coupon_type,
</if>
<if
test=
"maxDuration != null"
>
max_duration,
</if>
<if
test=
"duration != null and duration != ''"
>
duration,
</if>
<if
test=
"minPrice != null"
>
min_price,
</if>
<if
test=
"subPrice != null"
>
sub_price,
</if>
<if
test=
"sourceType != null"
>
source_type,
</if>
<if
test=
"platformType != null"
>
platform_type,
</if>
<if
test=
"startDate != null"
>
start_date,
</if>
<if
test=
"endDate != null"
>
end_date,
</if>
<if
test=
"useDate != null"
>
use_date,
</if>
<if
test=
"useStatus != null"
>
use_status,
</if>
<if
test=
"isDelete != null"
>
is_delete,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"deleteBy != null"
>
delete_by,
</if>
<if
test=
"deleteTime != null"
>
delete_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"consumerId != null"
>
#{consumerId},
</if>
<if
test=
"couponId != null"
>
#{couponId},
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
#{couponCode},
</if>
<if
test=
"name != null and name != ''"
>
#{name},
</if>
<if
test=
"couponType != null"
>
#{couponType},
</if>
<if
test=
"maxDuration != null"
>
#{maxDuration},
</if>
<if
test=
"duration != null and duration != ''"
>
#{duration},
</if>
<if
test=
"minPrice != null"
>
#{minPrice},
</if>
<if
test=
"subPrice != null"
>
#{subPrice},
</if>
<if
test=
"sourceType != null"
>
#{sourceType},
</if>
<if
test=
"platformType != null"
>
#{platformType},
</if>
<if
test=
"startDate != null"
>
#{startDate},
</if>
<if
test=
"endDate != null"
>
#{endDate},
</if>
<if
test=
"useDate != null"
>
#{useDate},
</if>
<if
test=
"useStatus != null"
>
#{useStatus},
</if>
<if
test=
"isDelete != null"
>
#{isDelete},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"deleteBy != null"
>
#{deleteBy},
</if>
<if
test=
"deleteTime != null"
>
#{deleteTime},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
</trim>
</insert>
<update
id=
"updateSConsumerCoupon"
parameterType=
"SConsumerCoupon"
>
update s_consumer_coupon
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"consumerId != null"
>
consumer_id = #{consumerId},
</if>
<if
test=
"couponId != null"
>
coupon_id = #{couponId},
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code = #{couponCode},
</if>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"couponType != null"
>
coupon_type = #{couponType},
</if>
<if
test=
"maxDuration != null"
>
max_duration = #{maxDuration},
</if>
<if
test=
"duration != null and duration != ''"
>
duration = #{duration},
</if>
<if
test=
"minPrice != null"
>
min_price = #{minPrice},
</if>
<if
test=
"subPrice != null"
>
sub_price = #{subPrice},
</if>
<if
test=
"sourceType != null"
>
source_type = #{sourceType},
</if>
<if
test=
"platformType != null"
>
platform_type = #{platformType},
</if>
<if
test=
"startDate != null"
>
start_date = #{startDate},
</if>
<if
test=
"endDate != null"
>
end_date = #{endDate},
</if>
<if
test=
"useDate != null"
>
use_date = #{useDate},
</if>
<if
test=
"useStatus != null"
>
use_status = #{useStatus},
</if>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"deleteBy != null"
>
delete_by = #{deleteBy},
</if>
<if
test=
"deleteTime != null"
>
delete_time = #{deleteTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
</trim>
where id = #{id}
</update>
<delete
id=
"deleteSConsumerCouponById"
parameterType=
"Long"
>
delete from s_consumer_coupon where id = #{id}
</delete>
<delete
id=
"deleteSConsumerCouponByIds"
parameterType=
"String"
>
delete from s_consumer_coupon where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
share-system/src/main/resources/mapper/system/SRoomMapper.xml
View file @
38925589
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"share.system.mapper.SRoomMapper"
>
<resultMap
type=
"SRoom"
id=
"SRoomResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"storeId"
column=
"store_id"
/>
<result
property=
"storeName"
column=
"store_name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"roomType"
column=
"room_type"
/>
<result
property=
"images"
column=
"images"
/>
...
...
@@ -28,14 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectSRoomVo"
>
select id, store_id,
store_name,
name, room_type, images, facilities, info, status, price, door_lock_code, electric_control_code, password, params1, params2, create_by, create_time, update_by, update_time, remark from s_room
select id, store_id, name, room_type, images, facilities, info, status, price, door_lock_code, electric_control_code, password, params1, params2, create_by, create_time, update_by, update_time, remark from s_room
</sql>
<select
id=
"selectSRoomList"
parameterType=
"SRoom"
resultMap=
"SRoomResult"
>
<include
refid=
"selectSRoomVo"
/>
<where>
<if
test=
"storeId != null "
>
and store_id = #{storeId}
</if>
<if
test=
"storeName != null and storeName != ''"
>
and store_name like concat('%', #{storeName}, '%')
</if>
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
<if
test=
"roomType != null and roomType != ''"
>
and room_type = #{roomType}
</if>
<if
test=
"images != null and images != ''"
>
and images = #{images}
</if>
...
...
@@ -60,7 +58,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into s_room
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeId != null"
>
store_id,
</if>
<if
test=
"storeName != null"
>
store_name,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"roomType != null"
>
room_type,
</if>
<if
test=
"images != null"
>
images,
</if>
...
...
@@ -81,7 +78,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeId != null"
>
#{storeId},
</if>
<if
test=
"storeName != null"
>
#{storeName},
</if>
<if
test=
"name != null"
>
#{name},
</if>
<if
test=
"roomType != null"
>
#{roomType},
</if>
<if
test=
"images != null"
>
#{images},
</if>
...
...
@@ -106,7 +102,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update s_room
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"storeId != null"
>
store_id = #{storeId},
</if>
<if
test=
"storeName != null"
>
store_name = #{storeName},
</if>
<if
test=
"name != null"
>
name = #{name},
</if>
<if
test=
"roomType != null"
>
room_type = #{roomType},
</if>
<if
test=
"images != null"
>
images = #{images},
</if>
...
...
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