衡水老白干项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
newphonetour2.0/src/main/java/com/cjy/back/ybsjMessageInfo/dao/YbsjMessageInfoMapper.xml

766 lines
31 KiB

<?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.cjy.back.ybsjMessageInfo.dao.YbsjMessageInfoMapper">
<select id="getListDataFormFilterByPage" resultType="map" statementType="STATEMENT">
SELECT m.guid,
<foreach collection="list" item="item" index="index" separator=",">
<choose>
<when test="item.column_name == 'region'">
MC AS 'region'
</when>
<when test="item.column_name == 'subtype'">
s.dicname AS 'subtype'
</when>
<when test="item.column_name == 'scenicid'">
sname AS 'scenicid'
</when>
<when test="item.column_name == 'hotelid'">
hname AS 'hotelid'
</when>
<when test="item.column_name == 'foodid'">
ydf.name AS 'foodid'
</when>
<when test="item.column_name == 'specialtyfoodid'">
ymi.title AS 'specialtyfoodid'
</when>
<when test="item.column_name == 'activityid'">
ymii.title AS 'activityid'
</when>
<otherwise>
m.${item.column_name}
</otherwise>
</choose>
</foreach>
FROM ybsj_message_info m
LEFT JOIN sys_organ o ON m.region = BM
LEFT JOIN sys_dictionary s ON s.dicnum = m.subtype AND s.userkey = '${userkey}'
LEFT JOIN sys_dictionary s1 ON s1.dicnum = m.subtype AND s1.userkey = '${userkey}'
LEFT JOIN ybsj_scenic_info ysi ON m.scenicid = ysi.guid AND ysi.userkey = '${userkey}'
LEFT JOIN ybsj_hotel_info yhi ON yhi.guid = m.hotelid AND yhi.userkey = '${userkey}'
LEFT JOIN ybsj_delicacyfood ydf ON ydf.fid = m.foodid AND ydf.userkey = '${userkey}'
LEFT JOIN ybsj_message_info ymi ON ymi.guid = m.specialtyfoodid
LEFT JOIN ybsj_message_info ymii ON ymii.guid = m.activityid
WHERE m.userkey = '${userkey}' AND m.type = ${type}
<if test="title != null and title != ''">
AND m.title LIKE CONCAT('%','${title}','%')
</if>
<if test="region != null and region != ''">
AND m.region like CONCAT('${region}','%')
</if>
<if test="(sort != null and sort != '') or (isrecommend != null and isrecommend != '')">
ORDER BY
</if>
<if test="isrecommend != null and isrecommend != ''">
m.isrecommend ${isrecommend}
</if>
<if test="(isrecommend != null and isrecommend != '') and (sort != null and sort != '')">
,
</if>
<if test="sort != null and sort != ''">
m.sort ${sort}
</if>
</select>
<select id="scenicList" resultType="map">
SELECT guid,logo,title,region FROM ybsj_message_info WHERE type = #{type} AND userkey = #{userkey} ORDER BY isrecommend DESC, sort DESC
</select>
<update id="updateMessageInfoSort">
UPDATE ybsj_message_info SET sort = #{sort} WHERE guid = #{guid}
</update>
<update id="recommendMessageInfo">
UPDATE ybsj_message_info SET isrecommend = #{isrecommend} WHERE guid = #{guid}
</update>
<update id="updateIspopupMessageInfo">
UPDATE ybsj_message_info SET ispopup = #{ispopup} WHERE guid = #{guid}
</update>
<select id="selectIspopupCount" resultType="int">
select count(1) from ybsj_message_info WHERE userkey = #{userkey} and guid != #{guid} and ispopup = 'YES'
</select>
<update id="isdelMessageInfo">
UPDATE ybsj_message_info SET isdel = #{isdel} WHERE guid = #{guid}
</update>
<select id="selectDetailById" resultType="map" statementType="STATEMENT">
SELECT guid,
<foreach collection="list" item="item" index="index" separator=",">
${item.column_name}
</foreach>
FROM ybsj_message_info WHERE guid = ${guid}
</select>
<!--/*type = #{type},
isrecommend = #{isrecommend},
browsenum = #{browsenum},
upnum = #{upnum},
sort = #{sort},
createuserid = #{createuserid},
sendtime = #{sendtime},
createtime = #{createtime},
isdel = #{isdel},*/-->
<update id="updateMessageInfo" parameterType="com.cjy.back.ybsjMessageInfo.entity.YbsjMessageInfo">
UPDATE ybsj_message_info set
title = #{title},
subtitle = #{subtitle},
jointime = #{jointime},
address = #{address},
logo = #{logo},
region = #{region},
holdcompany = #{holdcompany},
content = #{content},
images = #{images},
remark = #{remark},
survey = #{survey},
regioncontent = #{regioncontent},
resources = #{resources},
historys = #{historys},
naturals = #{naturals},
special = #{special},
subtype = #{subtype},
lng = #{lng},
lat = #{lat},
videopath = #{videopath},
soundpath = #{soundpath},
scenicid = #{scenicid},
hotelid = #{hotelid},
foodid = #{foodid},
specialtyfoodid = #{specialtyfoodid},
activityid = #{activityid},
sub_column1 = #{sub_column1},
sub_column2 = #{sub_column2},
sub_column3 = #{sub_column3},
sub_column4 = #{sub_column4},
sub_column5 = #{sub_column5},
sub_column6 = #{sub_column6},
sub_column7 = #{sub_column7},
sub_column8 = #{sub_column8},
sub_column9 = #{sub_column9},
sub_column10 = #{sub_column10}
WHERE guid = #{guid}
</update>
<insert id="saveMessageInfo" parameterType="com.cjy.back.ybsjMessageInfo.entity.YbsjMessageInfo" useGeneratedKeys="true" keyProperty="guid">
INSERT INTO ybsj_message_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="type != null and type != ''">
type,
</if>
<if test="title != null and title != ''">
title,
</if>
<if test="subtitle != null and subtitle != ''">
subtitle,
</if>
<if test="jointime != null and jointime != ''">
jointime,
</if>
<if test="address != null and address != ''">
address,
</if>
<if test="logo != null and logo != ''">
logo,
</if>
<if test="region != null and region != ''">
region,
</if>
<if test="holdcompany != null and holdcompany != ''">
holdcompany,
</if>
<if test="isrecommend != null and isrecommend != ''">
isrecommend,
</if>
<if test="browsenum != null">
browsenum,
</if>
<if test="upnum != null">
upnum,
</if>
<if test="sort != null">
sort,
</if>
<if test="createuserid != null">
createuserid,
</if>
<if test="sendtime != null">
sendtime,
</if>
<if test="createtime != null">
createtime,
</if>
<if test="content != null and content != ''">
content,
</if>
<if test="images != null and images != ''">
images,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="survey != null and survey != ''">
survey,
</if>
<if test="regioncontent != null and regioncontent != ''">
regioncontent,
</if>
<if test="resources != null and resources != ''">
resources,
</if>
<if test="historys != null and historys != ''">
historys,
</if>
<if test="naturals != null and naturals != ''">
naturals,
</if>
<if test="subtype != null and subtype != ''">
subtype,
</if>
<if test="lng != null and lng != ''">
lng,
</if>
<if test="lat != null and lat != ''">
lat,
</if>
<if test="isdel != null and isdel != ''">
isdel,
</if>
<if test="videopath != null and videopath != ''">
videopath,
</if>
<if test="soundpath != null and soundpath != ''">
soundpath,
</if>
<if test="special != null and special != ''">
special,
</if>
<if test="scenicid != null and scenicid != ''">
scenicid,
</if>
<if test="hotelid != null and hotelid != ''">
hotelid,
</if>
<if test="foodid != null and foodid != ''">
foodid,
</if>
<if test="specialtyfoodid != null and specialtyfoodid != ''">
specialtyfoodid,
</if>
<if test="activityid != null and activityid != ''">
activityid,
</if>
<if test="superuserid != null and superuserid != ''">
superuserid,
</if>
<if test="userkey != null and userkey != ''">
userkey,
</if>
<if test="sub_column1 != null and sub_column1 != ''">
sub_column1,
</if>
<if test="sub_column2 != null and sub_column2 != ''">
sub_column2,
</if>
<if test="sub_column3 != null and sub_column3 != ''">
sub_column3,
</if>
<if test="sub_column4 != null and sub_column4 != ''">
sub_column4,
</if>
<if test="sub_column5 != null and sub_column5 != ''">
sub_column5,
</if>
<if test="sub_column6 != null and sub_column6 != ''">
sub_column6,
</if>
<if test="sub_column7 != null and sub_column7 != ''">
sub_column7,
</if>
<if test="sub_column8 != null and sub_column8 != ''">
sub_column8,
</if>
<if test="sub_column9 != null and sub_column9 != ''">
sub_column9,
</if>
<if test="sub_column10 != null and sub_column10 != ''">
sub_column10,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="type != null and type != ''">
#{type},
</if>
<if test="title != null and title != ''">
#{title},
</if>
<if test="subtitle != null and subtitle != ''">
#{subtitle},
</if>
<if test="jointime != null and jointime != ''">
#{jointime},
</if>
<if test="address != null and address != ''">
#{address},
</if>
<if test="logo != null and logo != ''">
#{logo},
</if>
<if test="region != null and region != ''">
#{region},
</if>
<if test="holdcompany != null and holdcompany != ''">
#{holdcompany},
</if>
<if test="isrecommend != null and isrecommend != ''">
#{isrecommend},
</if>
<if test="browsenum != null">
#{browsenum},
</if>
<if test="upnum != null">
#{upnum},
</if>
<if test="sort != null">
#{sort},
</if>
<if test="createuserid != null">
#{createuserid},
</if>
<if test="sendtime != null">
#{sendtime},
</if>
<if test="createtime != null">
#{createtime},
</if>
<if test="content != null and content != ''">
#{content},
</if>
<if test="images != null and images != ''">
#{images},
</if>
<if test="remark != null and remark != ''">
#{remark},
</if>
<if test="survey != null and survey != ''">
#{survey},
</if>
<if test="regioncontent != null and regioncontent != ''">
#{regioncontent},
</if>
<if test="resources != null and resources != ''">
#{resources},
</if>
<if test="historys != null and historys != ''">
#{historys},
</if>
<if test="naturals != null and naturals != ''">
#{naturals},
</if>
<if test="subtype != null and subtype != ''">
#{subtype},
</if>
<if test="lng != null and lng != ''">
#{lng},
</if>
<if test="lat != null and lat != ''">
#{lat},
</if>
<if test="isdel != null and isdel != ''">
#{isdel},
</if>
<if test="videopath != null and videopath != ''">
#{videopath},
</if>
<if test="soundpath != null and soundpath != ''">
#{soundpath},
</if>
<if test="special != null and special != ''">
#{special},
</if>
<if test="scenicid != null and scenicid != ''">
#{scenicid},
</if>
<if test="hotelid != null and hotelid != ''">
#{hotelid},
</if>
<if test="foodid != null and foodid != ''">
#{foodid},
</if>
<if test="specialtyfoodid != null and specialtyfoodid != ''">
#{specialtyfoodid},
</if>
<if test="activityid != null and activityid != ''">
#{activityid},
</if>
<if test="superuserid != null and superuserid != ''">
#{superuserid},
</if>
<if test="userkey != null and userkey != ''">
#{userkey},
</if>
<if test="sub_column1 != null and sub_column1 != ''">
#{sub_column1},
</if>
<if test="sub_column2 != null and sub_column2 != ''">
#{sub_column2},
</if>
<if test="sub_column3 != null and sub_column3 != ''">
#{sub_column3},
</if>
<if test="sub_column4 != null and sub_column4 != ''">
#{sub_column4},
</if>
<if test="sub_column5 != null and sub_column5 != ''">
#{sub_column5},
</if>
<if test="sub_column6 != null and sub_column6 != ''">
#{sub_column6},
</if>
<if test="sub_column7 != null and sub_column7 != ''">
#{sub_column7},
</if>
<if test="sub_column8 != null and sub_column8 != ''">
#{sub_column8},
</if>
<if test="sub_column9 != null and sub_column9 != ''">
#{sub_column9},
</if>
<if test="sub_column10 != null and sub_column10 != ''">
#{sub_column10},
</if>
</trim>
</insert>
<delete id="deleteMessageInfo">
DELETE FROM ybsj_message_info WHERE guid = #{guid}
</delete>
<select id="selectDetailAllById" resultType="com.cjy.back.ybsjMessageInfo.entity.YbsjMessageInfo">
SELECT * FROM ybsj_message_info WHERE guid = #{guid}
</select>
<select id="selectDataByType" resultType="map">
SELECT guid,title FROM ybsj_message_info WHERE type = #{type} AND userkey = #{userkey}
</select>
<select id="selectCheckSubColumnValueById" resultType="string" statementType="STATEMENT">
SELECT GROUP_CONCAT(title) AS CC FROM ybsj_message_info WHERE FIND_IN_SET(guid, (SELECT ${column_name} FROM ybsj_message_info WHERE guid = ${guid}))
</select>
<select id="getMessageInfoFormFilterByPage" parameterType="map" resultType="map" statementType="STATEMENT">
SELECT m.guid,m.type,
<if test="map.lng != null and map.lng != '' and map.lat != null and map.lat != '' ">
ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW( SIN( (${map.lat} *
PI() / 180 - m.lat * PI() / 180 ) / 2 ), 2 )
+
COS( ${map.lat} *
PI() / 180 ) * COS( m.lat * PI() / 180 ) *
POW( SIN( (${map.lng}
* PI() / 180 - m.lng * PI() / 180) / 2 ), 2 )
)
) * 1000
) AS distance,
</if>
<foreach collection="map.tableFeild" item="item" index="index" separator=",">
<choose>
<when test="item.column_name == 'region'">
ifnull(m.region,"") AS 'bm',ifnull(MC,"") AS 'region'
</when>
<when test="item.column_name == 'subtype'">
ifnull(s.dicname,"") AS 'subtype'
</when>
<when test="item.column_name == 'scenicid'">
ifnull(sname,"") AS 'scenicid'
</when>
<when test="item.column_name == 'hotelid'">
ifnull(hname,"") AS 'hotelid'
</when>
<when test="item.column_name == 'foodid'">
ifnull(ydf.name,"") AS 'foodid'
</when>
<when test="item.column_name == 'specialtyfoodid'">
ifnull(ymi.title,"") AS 'specialtyfoodid'
</when>
<when test="item.column_name == 'activityid'">
ifnull(ymii.title,"") AS 'activityid'
</when>
<otherwise>
ifnull(m.${item.column_name},"") AS ${item.column_name}
</otherwise>
</choose>
</foreach>
FROM ybsj_message_info m
LEFT JOIN sys_organ o ON m.region = BM
LEFT JOIN sys_dictionary s ON s.dicnum = m.subtype AND s.userkey = '${map.userkey}'
LEFT JOIN sys_dictionary s1 ON s1.dicnum = m.subtype AND s1.userkey = '${map.userkey}'
LEFT JOIN ybsj_scenic_info ysi ON m.scenicid = ysi.guid AND ysi.userkey = '${map.userkey}'
LEFT JOIN ybsj_hotel_info yhi ON yhi.guid = m.hotelid AND yhi.userkey = '${map.userkey}'
LEFT JOIN ybsj_delicacyfood ydf ON ydf.fid = m.foodid AND ydf.userkey = '${map.userkey}'
LEFT JOIN ybsj_message_info ymi ON ymi.guid = m.specialtyfoodid
LEFT JOIN ybsj_message_info ymii ON ymii.guid = m.activityid
WHERE m.userkey = '${map.userkey}' AND m.isdel = "NO"
<if test="map.title != null and map.title != ''">
AND m.title like CONCAT('%','${map.title}','%')
</if>
<if test="map.type != null and map.type != ''">
AND m.type = '${map.type}'
</if>
<if test="map.scenicid != null and map.scenicid != ''">
AND m.scenicid = '${map.scenicid}'
</if>
<if test="map.hotelid != null and map.hotelid != ''">
AND m.hotelid = '${map.hotelid}'
</if>
<if test="map.isrecommend != null and map.isrecommend != ''">
AND m.isrecommend = '${map.isrecommend}'
</if>
<if test="map.region != null and map.region != ''">
AND m.region like CONCAT('${map.region}','%')
</if>
<if test="map.sort != null and map.sort != ''">
ORDER BY
</if>
<if test="map.sort == 1"> m.sort DESC</if>
<if test="map.sort == 2"> m.isrecommend DESC,m.sort DESC</if>
<if test="map.sort == 3"> distance ASC</if>
<if test="map.sort == 4"> distance DESC</if>
<if test="map.sort == 5"> m.browsenum ASC</if>
<if test="map.sort == 6"> m.browsenum DESC</if>
</select>
<select id="getMessageInfoFormFilter_twoByPage" parameterType="map" resultType="map" statementType="STATEMENT">
SELECT m.guid,m.type,
<if test="map.lng != null and map.lng != '' and map.lat != null and map.lat != '' ">
ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW( SIN( (${map.lat} *
PI() / 180 - m.lat * PI() / 180 ) / 2 ), 2 )
+
COS( ${map.lat} *
PI() / 180 ) * COS( m.lat * PI() / 180 ) *
POW( SIN( (${map.lng}
* PI() / 180 - m.lng * PI() / 180) / 2 ), 2 )
)
) * 1000
) AS distance,
</if>
<foreach collection="map.tableFeild" item="item" index="index" separator=",">
<choose>
<when test="item.column_name == 'region'">
ifnull(m.region,"") AS 'bm',ifnull(MC,"") AS 'region'
</when>
<when test="item.column_name == 'subtype'">
ifnull(s.dicname,"") AS 'subtype'
</when>
<when test="item.column_name == 'scenicid'">
ifnull(sname,"") AS 'scenicid'
</when>
<when test="item.column_name == 'hotelid'">
ifnull(hname,"") AS 'hotelid'
</when>
<when test="item.column_name == 'foodid'">
ifnull(ydf.name,"") AS 'foodid'
</when>
<when test="item.column_name == 'specialtyfoodid'">
ifnull(ymi.title,"") AS 'specialtyfoodid'
</when>
<when test="item.column_name == 'activityid'">
ifnull(ymii.title,"") AS 'activityid'
</when>
<otherwise>
ifnull(m.${item.column_name},"") AS ${item.column_name}
</otherwise>
</choose>
</foreach>
FROM ybsj_message_info m
LEFT JOIN sys_organ o ON m.region = BM
LEFT JOIN sys_dictionary s ON s.dicnum = m.subtype AND s.userkey = '${map.userkey}'
LEFT JOIN sys_dictionary s1 ON s1.dicnum = m.subtype AND s1.userkey = '${map.userkey}'
LEFT JOIN ybsj_scenic_info ysi ON m.scenicid = ysi.guid AND ysi.userkey = '${map.userkey}'
LEFT JOIN ybsj_hotel_info yhi ON yhi.guid = m.hotelid AND yhi.userkey = '${map.userkey}'
LEFT JOIN ybsj_delicacyfood ydf ON ydf.fid = m.foodid AND ydf.userkey = '${map.userkey}'
LEFT JOIN ybsj_message_info ymi ON ymi.guid = m.specialtyfoodid
LEFT JOIN ybsj_message_info ymii ON ymii.guid = m.activityid
WHERE m.userkey = '${map.userkey}' AND m.isdel = "NO"
<if test="map.title != null and map.title != ''">
AND m.title like CONCAT('%','${map.title}','%')
</if>
<if test="map.type != null and map.type != ''">
AND m.type = '${map.type}'
</if>
<if test="map.scenicid != null and map.scenicid != ''">
AND m.scenicid = '${map.scenicid}'
</if>
<if test="map.hotelid != null and map.hotelid != ''">
AND m.hotelid = '${map.hotelid}'
</if>
<if test="map.isrecommend != null and map.isrecommend != ''">
AND m.isrecommend = '${map.isrecommend}'
</if>
<if test="map.region != null and map.region != ''">
AND m.region like CONCAT('${map.region}','%')
</if>
<if test="map.sql != ''">
${map.sql}
</if>
<if test="map.sort != null and map.sort != ''">
ORDER BY
</if>
<if test="map.sort == 1"> m.sort DESC</if>
<if test="map.sort == 2"> m.isrecommend DESC,m.sort DESC</if>
<if test="map.sort == 3"> distance ASC</if>
<if test="map.sort == 4"> distance DESC</if>
<if test="map.sort == 5"> m.browsenum ASC</if>
<if test="map.sort == 6"> m.browsenum DESC</if>
</select>
<select id="getMessageInfoFormFilter_foodByPage" parameterType="map" resultType="map">
SELECT
ymi.guid,
ymi.title,
ymi.logo,
ymi.images,
ymi.content,
ymi.region bm,
yfsg.sid
,MIN(ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW( SIN( ( #{map.lat} *
PI() / 180 - ybmi.lat * PI() / 180 ) / 2 ), 2 )
+
COS( #{map.lat} *
PI() / 180 ) * COS( ybmi.lat * PI() / 180 ) *
POW( SIN( ( #{map.lng}
* PI() / 180 - ybmi.lng * PI() / 180) / 2 ), 2 )
)
) * 1000
)) AS distance
FROM
ybsj_message_info ymi
LEFT JOIN ybsj_food_specialgood_shop yfsg ON ymi.guid = yfsg.fid
LEFT JOIN ybsj_message_info ybmi ON ybmi.type = #{map.shopType}
AND ybmi.userkey = #{map.userkey}
AND ybmi.guid = yfsg.sid
WHERE
ymi.type = #{map.type}
AND ymi.userkey = #{map.userkey}
<if test="map.title != null and map.title != ''">
AND ymi.title like CONCAT('%','${map.title}','%')
</if>
<if test="map.region != null and map.region != ''">
AND ymi.region like CONCAT('${map.region}','%')
</if>
GROUP BY ymi.guid
<if test="map.sort != null and map.sort != ''">
ORDER BY
</if>
<if test="map.sort == 1"> ymi.sort DESC</if>
<if test="map.sort == 2"> ymi.isrecommend DESC,ymi.sort DESC</if>
<if test="map.sort == 3"> IF(ISNULL(yfsg.sid),1,0),distance ASC</if>
<if test="map.sort == 4"> IF(ISNULL(yfsg.sid),1,0),distance DESC</if>
</select>
<select id="getMessageDetailFormId" parameterType="map" resultType="map" statementType="STATEMENT">
SELECT m.guid,m.type,m.browsenum,m.upnum,m.createtime,
<if test="map.lng != null and map.lng != '' and map.lat != null and map.lat != '' ">
ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW( SIN( (${map.lat} *
PI() / 180 - m.lat * PI() / 180 ) / 2 ), 2 )
+
COS( ${map.lat} *
PI() / 180 ) * COS( m.lat * PI() / 180 ) *
POW( SIN( (${map.lng}
* PI() / 180 - m.lng * PI() / 180) / 2 ), 2 )
)
) * 1000
) AS distance,
</if>
<foreach collection="map.tableFeild" item="item" index="index" separator=",">
<choose>
<when test="item.column_name == 'region'">
ifnull(m.region,"") AS 'bm',ifnull(MC,"") AS 'region'
</when>
<when test="item.column_name == 'subtype'">
ifnull(s.dicname,"") AS 'subtype'
</when>
<when test="item.column_name == 'scenicid'">
ifnull(sname,"") AS 'scenicid'
</when>
<when test="item.column_name == 'hotelid'">
ifnull(hname,"") AS 'hotelid'
</when>
<when test="item.column_name == 'foodid'">
ifnull(ydf.name,"") AS 'foodid'
</when>
<when test="item.column_name == 'specialtyfoodid'">
ifnull(ymi.title,"") AS 'specialtyfoodid'
</when>
<when test="item.column_name == 'activityid'">
ifnull(ymii.title,"") AS 'activityid'
</when>
<otherwise>
ifnull(m.${item.column_name},"") AS '${item.column_name}'
</otherwise>
</choose>
</foreach>
FROM ybsj_message_info m
LEFT JOIN sys_organ o ON m.region = BM
LEFT JOIN sys_dictionary s ON s.dicnum = m.subtype AND s.userkey = '${map.userkey}'
LEFT JOIN sys_dictionary s1 ON s1.dicnum = m.subtype AND s1.userkey = '${map.userkey}'
LEFT JOIN ybsj_scenic_info ysi ON m.scenicid = ysi.guid AND ysi.userkey = '${map.userkey}'
LEFT JOIN ybsj_hotel_info yhi ON yhi.guid = m.hotelid AND yhi.userkey = '${map.userkey}'
LEFT JOIN ybsj_delicacyfood ydf ON ydf.fid = m.foodid AND ydf.userkey = '${map.userkey}'
LEFT JOIN ybsj_message_info ymi ON ymi.guid = m.specialtyfoodid
LEFT JOIN ybsj_message_info ymii ON ymii.guid = m.activityid
WHERE m.guid = ${map.guid} AND m.userkey = '${map.userkey}' AND m.isdel = "NO"
<if test="map.type != null and map.type != ''">
AND m.type = '${map.type}'
</if>
</select>
<update id="updateMessageBrowsenumFeildFormId">
UPDATE ybsj_message_info SET browsenum = IFNULL(browsenum, 0) + 1 WHERE guid= #{map.guid}
</update>
<update id="updateMessageUpnumFeildFormId">
UPDATE ybsj_message_info SET upnum = IFNULL(upnum, 0) + 1 WHERE guid= #{map.guid}
</update>
<select id="test" resultType="string">
SELECT title FROM ybsj_message_info WHERE guid = 28
</select>
<select id="selectRecommendedAttractions" resultType="map">
select guid,title,logo from ybsj_message_info where type in (
select dicnum from ybsj_message_type where userkey=#{key} and mestype ='yule'
) and userkey=#{key}
</select>
<!-- 添加记录 -->
<insert id="insertContent" parameterType="com.cjy.back.ybsjMessageInfo.entity.YbsjTkContent">
INSERT INTO ybsj_tk_content (message_info_id, content, start_time, end_time)
VALUES (#{messageInfoId}, #{content}, #{startTime}, #{endTime})
</insert>
<!-- 修改记录 -->
<update id="updateContent" parameterType="com.cjy.back.ybsjMessageInfo.entity.YbsjTkContent">
UPDATE ybsj_tk_content
SET content = #{content},
start_time = #{startTime},
end_time = #{endTime}
WHERE message_info_id = #{messageInfoId}
</update>
<!-- 根据 message_info_id 查询记录 -->
<select id="selectContentById" parameterType="java.lang.Long" resultType="com.cjy.back.ybsjMessageInfo.entity.YbsjTkContent">
SELECT message_info_id, content, start_time, end_time,id
FROM ybsj_tk_content
WHERE message_info_id = #{message_info_id}
</select>
</mapper>