Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 47f21cec
authored
Mar 18, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能V1.0.0开发 用户数据--think.wang
1 parent
48b6e762
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
13 deletions
src/main/java/com/glsx/smart/controller/SysFileController.java
src/main/java/com/glsx/smart/controller/UserRelationController.java
src/main/java/com/glsx/smart/dao/mapper/SmartUserRelationMapper.java
src/main/java/com/glsx/smart/service/SmartSysFileService.java
src/main/java/com/glsx/smart/service/SmartUserRelationService.java
src/main/java/com/glsx/smart/service/impl/SmartSysFileServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
src/main/resources/mapper/SmartSceneMapper.xml
src/main/resources/mapper/SmartUserRelationMapper.xml
src/main/java/com/glsx/smart/controller/SysFileController.java
View file @
47f21ce
...
@@ -34,7 +34,7 @@ public class SysFileController {
...
@@ -34,7 +34,7 @@ public class SysFileController {
@RequestMapping
(
value
=
"/findAll"
,
method
=
{
RequestMethod
.
GET
})
@RequestMapping
(
value
=
"/findAll"
,
method
=
{
RequestMethod
.
GET
})
@ApiOperation
(
value
=
"查询图片"
)
@ApiOperation
(
value
=
"查询图片"
)
public
R
findAll
(
@RequestParam
(
"type"
)
String
type
)
{
public
R
findAll
(
@RequestParam
(
"type"
)
Byte
type
)
{
List
<
FileDTO
>
fileDTOS
=
sysFileService
.
findByType
(
type
);
List
<
FileDTO
>
fileDTOS
=
sysFileService
.
findByType
(
type
);
return
R
.
ok
(
JSONObject
.
toJSONString
(
fileDTOS
));
return
R
.
ok
(
JSONObject
.
toJSONString
(
fileDTOS
));
}
}
...
...
src/main/java/com/glsx/smart/controller/UserRelationController.java
0 → 100644
View file @
47f21ce
package
com
.
glsx
.
smart
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.service.SmartUserRelationService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Title: UserRelationController.java
* @Description:用户关系控制类
* @author think.wang
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
@RestController
@RequestMapping
(
"/user"
)
public
class
UserRelationController
{
@Autowired
private
SmartUserRelationService
userRelationService
;
@ResponseBody
@RequestMapping
(
value
=
"/getSingle"
,
method
=
{
RequestMethod
.
POST
})
public
SmartUserRelation
getSingle
(
SmartUserRelation
userRelation
){
return
userRelationService
.
getSingle
(
userRelation
);
}
@ResponseBody
@RequestMapping
(
value
=
"/add"
,
method
=
{
RequestMethod
.
POST
})
public
boolean
add
(
SmartUserRelation
userRelation
){
log
.
info
(
"/user/add保存数据参数:{}"
,
JSON
.
toJSONString
(
userRelation
));
return
userRelationService
.
insertSelective
(
userRelation
)
>
0
?
true
:
false
;
}
}
src/main/java/com/glsx/smart/dao/mapper/SmartUserRelationMapper.java
View file @
47f21ce
package
com
.
glsx
.
smart
.
dao
.
mapper
;
package
com
.
glsx
.
smart
.
dao
.
mapper
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -25,4 +26,7 @@ public interface SmartUserRelationMapper
...
@@ -25,4 +26,7 @@ public interface SmartUserRelationMapper
int
updateBatchSelective
(
List
<
SmartUserRelation
>
list
);
int
updateBatchSelective
(
List
<
SmartUserRelation
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
SmartUserRelation
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
SmartUserRelation
>
list
);
SmartUserRelation
getSingle
(
SmartUserRelation
record
);
}
}
src/main/java/com/glsx/smart/service/SmartSysFileService.java
View file @
47f21ce
package
com
.
glsx
.
smart
.
service
;
package
com
.
glsx
.
smart
.
service
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartSysFile
;
import
com.glsx.smart.dao.entity.SmartSysFile
;
import
com.glsx.smart.pojo.FileDTO
;
import
com.glsx.smart.pojo.FileDTO
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
...
@@ -18,7 +17,7 @@ public interface SmartSysFileService {
...
@@ -18,7 +17,7 @@ public interface SmartSysFileService {
int
insertOrUpdate
(
SmartSysFile
record
);
int
insertOrUpdate
(
SmartSysFile
record
);
List
<
FileDTO
>
findByType
(
String
type
);
List
<
FileDTO
>
findByType
(
Byte
type
);
void
saveFile
(
List
<
FileDTO
>
files
);
void
saveFile
(
List
<
FileDTO
>
files
);
...
...
src/main/java/com/glsx/smart/service/SmartUserRelationService.java
View file @
47f21ce
package
com
.
glsx
.
smart
.
service
;
package
com
.
glsx
.
smart
.
service
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -18,7 +19,7 @@ public interface SmartUserRelationService {
...
@@ -18,7 +19,7 @@ public interface SmartUserRelationService {
int
insertSelective
(
SmartUserRelation
record
);
int
insertSelective
(
SmartUserRelation
record
);
List
<
SmartUserRelation
>
selectByExample
(
SmartUserRelation
example
);
SmartUserRelation
getSingle
(
SmartUserRelation
record
);
SmartUserRelation
selectByPrimaryKey
(
Long
id
);
SmartUserRelation
selectByPrimaryKey
(
Long
id
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartSysFileServiceImpl.java
View file @
47f21ce
...
@@ -50,7 +50,7 @@ public class SmartSysFileServiceImpl implements SmartSysFileService {
...
@@ -50,7 +50,7 @@ public class SmartSysFileServiceImpl implements SmartSysFileService {
* @return
* @return
*/
*/
@Override
@Override
public
List
<
FileDTO
>
findByType
(
String
type
)
{
public
List
<
FileDTO
>
findByType
(
Byte
type
)
{
List
<
SmartSysFile
>
list
=
smartSysFileMapper
.
findByType
(
type
);
List
<
SmartSysFile
>
list
=
smartSysFileMapper
.
findByType
(
type
);
List
<
FileDTO
>
fileDTOS
=
list
.
stream
().
map
(
index
->
{
List
<
FileDTO
>
fileDTOS
=
list
.
stream
().
map
(
index
->
{
FileDTO
fileDTO
=
new
FileDTO
();
FileDTO
fileDTO
=
new
FileDTO
();
...
...
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
View file @
47f21ce
package
com
.
glsx
.
smart
.
service
.
impl
;
package
com
.
glsx
.
smart
.
service
.
impl
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.dao.mapper.SmartUserRelationMapper
;
import
com.glsx.smart.dao.mapper.SmartUserRelationMapper
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
...
@@ -10,6 +8,9 @@ import com.glsx.smart.service.SmartUserRelationService;
...
@@ -10,6 +8,9 @@ import com.glsx.smart.service.SmartUserRelationService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -49,8 +50,8 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
...
@@ -49,8 +50,8 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
}
}
@Override
@Override
public
List
<
SmartUserRelation
>
selectByExample
(
SmartUserRelation
example
)
{
public
SmartUserRelation
getSingle
(
SmartUserRelation
record
)
{
return
smartUserRelationMapper
.
select
(
example
);
return
smartUserRelationMapper
.
getSingle
(
record
);
}
}
@Override
@Override
...
...
src/main/resources/mapper/SmartSceneMapper.xml
View file @
47f21ce
...
@@ -442,6 +442,9 @@
...
@@ -442,6 +442,9 @@
<if
test=
"typeKey != null and typeKey != ''"
>
<if
test=
"typeKey != null and typeKey != ''"
>
and t.type_key = #{typeKey,jdbcType=VARCHAR}
and t.type_key = #{typeKey,jdbcType=VARCHAR}
</if>
</if>
<if
test=
"userId != null and userId != ''"
>
and t.user_id = #{userId,jdbcType=BIGINT}
</if>
</where>
</where>
order by t.create_time desc
order by t.create_time desc
</select>
</select>
...
...
src/main/resources/mapper/SmartUserRelationMapper.xml
View file @
47f21ce
...
@@ -290,4 +290,17 @@
...
@@ -290,4 +290,17 @@
</if>
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"getSingle"
parameterType=
"com.glsx.smart.dao.entity.SmartUserRelation"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from smart_user_relation
where 1 = 1
<if
test=
"phone != null and phone != ''"
>
and phone = #{phone,jdbcType=VARCHAR}
</if>
<if
test=
"channel != null"
>
and channel = #{channel,jdbcType=TINYINT}
</if>
limit 1
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment