Commit cdbfa57e authored by daniel's avatar daniel

style(service): 新增服务模块+子类型多选

parent a90d382d
...@@ -4,7 +4,10 @@ import lombok.Data; ...@@ -4,7 +4,10 @@ import lombok.Data;
@Data @Data
public class JoyfulRichTextBean { public class JoyfulRichTextBean {
// 服务类型(3:特色民宿:4:旅游景点,5:特色餐饮 6:当地特产 7: 应急避险 8: 医疗点位 9:运动产品)
private String type; private String type;
// 点位类型 (1:打卡点,2:服务驿站,3:民宿:4:景点,5:餐饮)
private String category;
private String title; private String title;
private String lng; private String lng;
private String lat; private String lat;
......
...@@ -20,5 +20,5 @@ public interface JoyfulRichTextMapper { ...@@ -20,5 +20,5 @@ public interface JoyfulRichTextMapper {
List<JoyfulRichText> getJoyfulRichTextById(@Param("id") String id); List<JoyfulRichText> getJoyfulRichTextById(@Param("id") String id);
List<JoyfulRichText> getJoyfulRichTextList(@Param("type") String type, @Param("title") String title); List<JoyfulRichText> getJoyfulRichTextList(@Param("type") String type, @Param("title") String title,@Param("category") String category);
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
INSERT INTO gksite.joyful_rich_text( INSERT INTO gksite.joyful_rich_text(
userId userId
,type ,type
,category
,title ,title
,address ,address
,lng ,lng
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
) VALUES ( ) VALUES (
#{userId} #{userId}
,#{type} ,#{type}
,#{category}
,#{title} ,#{title}
,#{address} ,#{address}
,#{lng} ,#{lng}
...@@ -46,6 +48,7 @@ ...@@ -46,6 +48,7 @@
SET SET
userId = #{userId} userId = #{userId}
,type = #{type} ,type = #{type}
,category = #{category}
,title = #{title} ,title = #{title}
,address = #{address} ,address = #{address}
,lng = #{lng} ,lng = #{lng}
...@@ -75,25 +78,23 @@ ...@@ -75,25 +78,23 @@
</update> </update>
<select id="getJoyfulRichTextById" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.JoyfulRichText"> <select id="getJoyfulRichTextById" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.JoyfulRichText">
SELECT SELECT id
id , userId
,userId , type
,type , title
,title , address
,address , lng
,lng , lat
,lat , content
,content , img_url AS imgUrl
,img_url AS imgUrl , remark1
,remark1 , remark2
,remark2 , remark3
,remark3 , remark4
,remark4 , status
,status , category
FROM FROM gksite.joyful_rich_text
gksite.joyful_rich_text WHERE id = #{id}
WHERE
id = #{id}
</select> </select>
<select id="getJoyfulRichTextList" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.JoyfulRichText"> <select id="getJoyfulRichTextList" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.JoyfulRichText">
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
,remark4 ,remark4
,type ,type
,status ,status
,category
FROM FROM
gksite.joyful_rich_text gksite.joyful_rich_text
WHERE WHERE
...@@ -120,5 +122,8 @@ ...@@ -120,5 +122,8 @@
<if test="title != null and title != ''"> <if test="title != null and title != ''">
AND title like concat('%',#{title},'%') AND title like concat('%',#{title},'%')
</if> </if>
<if test="category != null and category != ''">
AND FIND_IN_SET(#{category}, category)
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,7 +6,10 @@ import lombok.Data; ...@@ -6,7 +6,10 @@ import lombok.Data;
public class JoyfulRichText { public class JoyfulRichText {
private String id; private String id;
private String userId; private String userId;
// 服务类型(3:特色民宿:4:旅游景点,5:特色餐饮 6:当地特产 7: 应急避险 8: 医疗点位 9:运动产品)
private String type; private String type;
// 点位类型 (1:打卡点,2:服务驿站,3:民宿:4:景点,5:餐饮)
private String category;
private String title; private String title;
private String address; private String address;
private String lng; private String lng;
......
...@@ -82,7 +82,7 @@ public class JoyfulRichTextService { ...@@ -82,7 +82,7 @@ public class JoyfulRichTextService {
* @return * @return
*/ */
public List<JoyfulRichText> getJoyfulRichTextList(JoyfulRichTextBean joyfulRichTextBean) { public List<JoyfulRichText> getJoyfulRichTextList(JoyfulRichTextBean joyfulRichTextBean) {
List<JoyfulRichText> joyfulRichTextList = joyfulRichTextMapper.getJoyfulRichTextList(joyfulRichTextBean.getType(), joyfulRichTextBean.getTitle()); List<JoyfulRichText> joyfulRichTextList = joyfulRichTextMapper.getJoyfulRichTextList(joyfulRichTextBean.getType(), joyfulRichTextBean.getTitle(),joyfulRichTextBean.getCategory());
if (StringUtils.isNotBlank(joyfulRichTextBean.getDistance())) { if (StringUtils.isNotBlank(joyfulRichTextBean.getDistance())) {
joyfulRichTextList = joyfulRichTextList.stream().filter(model -> this.notGtDistance(model, joyfulRichTextBean)).collect(Collectors.toList()); joyfulRichTextList = joyfulRichTextList.stream().filter(model -> this.notGtDistance(model, joyfulRichTextBean)).collect(Collectors.toList());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment