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.
ocr/jyjz-system/jyjz-system-cms/target/classes/mapper/cms/SiteinfoMapper.xml

196 lines
11 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="cn.jyjz.xiaoyao.cms.dataDao.SiteinfoMybatisDao">
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.cms.dataobject.Siteinfo">
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="SITEID" property="siteid" jdbcType="BIGINT"/>
<result column="CHANNELID" property="channelid" jdbcType="BIGINT"/>
<result column="TITLE" property="title" jdbcType="VARCHAR"/>
<result column="TITLESHORT" property="titleshort" jdbcType="VARCHAR"/>
<result column="TITLECOLOR" property="titlecolor" jdbcType="VARCHAR"/>
<result column="TITLEBLOB" property="titleblob" jdbcType="INTEGER"/>
<result column="SOURCE" property="source" jdbcType="VARCHAR"/>
<result column="AUTHOR" property="author" jdbcType="VARCHAR"/>
<result column="ABSTRAC" property="abstrac" jdbcType="VARCHAR"/>
<result column="INDEXNO" property="indexno" jdbcType="VARCHAR"/>
<result column="IMAGEINDEX" property="imageindex" jdbcType="VARCHAR"/>
<result column="IMAGE" property="image" jdbcType="VARCHAR"/>
<result column="EXLINKS" property="exlinks" jdbcType="VARCHAR"/>
<result column="ATTACHMENT" property="attachment" jdbcType="VARCHAR"/>
<result column="TEMPLETPATH" property="templetpath" jdbcType="VARCHAR"/>
<result column="ISTOP" property="istop" jdbcType="CHAR"/>
<result column="ISHOT" property="ishot" jdbcType="INTEGER"/>
<result column="HOTENDTIME" property="hotendtime" jdbcType="BIGINT"/>
<result column="TOPENDTIME" property="topendtime" jdbcType="BIGINT"/>
<result column="CLICKNUM" property="clicknum" jdbcType="INTEGER"/>
<result column="CREATENUSERID" property="createnuserid" jdbcType="VARCHAR"/>
<result column="STAT" property="stat" jdbcType="CHAR"/>
<result column="APPROVALID" property="approvalid" jdbcType="BIGINT"/>
<result column="VIDEO" property="video" jdbcType="VARCHAR"/>
<result column="ISCOMMENT" property="iscomment" jdbcType="INTEGER"/>
<result column="TAGS" property="tags" jdbcType="VARCHAR"/>
<result column="OPENTIMETYPE" property="opentimetype" jdbcType="INTEGER"/>
<result column="INFOTIME" property="infotime" jdbcType="BIGINT"/>
<result column="HTMLINDEXNUM" property="htmlindexnum" jdbcType="BIGINT"/>
<result column="ORDERNUM" property="ordernum" jdbcType="INTEGER"/>
<result column="PROID" property="proid" jdbcType="VARCHAR"/>
<result column="STARTDATE" property="startdate" jdbcType="BIGINT"/>
<result column="ENDDATE" property="enddate" jdbcType="BIGINT"/>
<result column="CREATEUSER" property="createuser" jdbcType="VARCHAR"/>
<result column="CREATETIME" property="createtime" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<association property="sit" column="SITEID" select="cn.jyjz.xiaoyao.cms.dataDao.SitMybatisDao.selectById"></association>
<association property="channel" column="CHANNELID" select="cn.jyjz.xiaoyao.cms.dataDao.SitchannelMybatisDao.selectById"></association>
<collection property="siteinfoextendList" column="ID" select="cn.jyjz.xiaoyao.cms.dataDao.SiteinfoextendMybatisDao.selectByInfoId"/>
<collection property="infodistionaryList" column="ID" select="cn.jyjz.xiaoyao.cms.dataDao.InfodistionaryMybatisDao.selectByInfoId"/>
</resultMap>
<sql id="Base_Column_List">
ID AS id,
SITEID AS siteid,
CHANNELID AS channelid,
TITLE AS title,
TITLESHORT AS titleshort,
TITLECOLOR AS titlecolor,
TITLEBLOB AS titleblob,
SOURCE AS source,
AUTHOR AS author,
ABSTRAC AS abstrac,
INDEXNO AS indexno,
IMAGEINDEX AS imageindex,
IMAGE AS image,
EXLINKS AS exlinks,
ATTACHMENT AS attachment,
TEMPLETPATH AS templetpath,
ISTOP AS istop,
ISHOT AS ishot,
HOTENDTIME AS hotendtime,
TOPENDTIME AS topendtime,
CLICKNUM AS clicknum,
CREATENUSERID AS createnuserid,
STAT AS stat,
APPROVALID AS approvalid,
VIDEO AS video,
ISCOMMENT AS iscomment,
TAGS AS tags,
OPENTIMETYPE AS opentimetype,
INFOTIME AS infotime,
HTMLINDEXNUM AS htmlindexnum,
ORDERNUM AS ordernum,
PROID AS proid,
STARTDATE AS startdate,
ENDDATE AS enddate,
CREATEUSER AS createuser,
CREATETIME AS createtime,
UPDATEUSER AS updateuser,
UPDATETIME AS updatetime
</sql>
<sql id="Base_Where">
<where>
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="siteid != null"> and SITEID ${siteid.dataOp} ${siteid.likestar}#{siteid.value}${siteid.likeend}</if>
<if test="channelid != null"> and CHANNELID ${channelid.dataOp} ${channelid.likestar}#{channelid.value}${channelid.likeend}</if>
<if test="title != null"> and TITLE ${title.dataOp} ${title.likestar}#{title.value}${title.likeend}</if>
<if test="titleshort != null"> and TITLESHORT ${titleshort.dataOp} ${titleshort.likestar}#{titleshort.value}${titleshort.likeend}</if>
<if test="titlecolor != null"> and TITLECOLOR ${titlecolor.dataOp} ${titlecolor.likestar}#{titlecolor.value}${titlecolor.likeend}</if>
<if test="titleblob != null"> and TITLEBLOB ${titleblob.dataOp} ${titleblob.likestar}#{titleblob.value}${titleblob.likeend}</if>
<if test="source != null"> and SOURCE ${source.dataOp} ${source.likestar}#{source.value}${source.likeend}</if>
<if test="author != null"> and AUTHOR ${author.dataOp} ${author.likestar}#{author.value}${author.likeend}</if>
<if test="abstrac != null"> and ABSTRAC ${abstrac.dataOp} ${abstrac.likestar}#{abstrac.value}${abstrac.likeend}</if>
<if test="indexno != null"> and INDEXNO ${indexno.dataOp} ${indexno.likestar}#{indexno.value}${indexno.likeend}</if>
<if test="image != null"> and IMAGE ${image.dataOp} ${image.likestar}#{image.value}${image.likeend}</if>
<if test="exlinks != null"> and EXLINKS ${exlinks.dataOp} ${exlinks.likestar}#{exlinks.value}${exlinks.likeend}</if>
<if test="attachment != null"> and ATTACHMENT ${attachment.dataOp} ${attachment.likestar}#{attachment.value}${attachment.likeend}</if>
<if test="templetpath != null"> and TEMPLETPATH ${templetpath.dataOp} ${templetpath.likestar}#{templetpath.value}${templetpath.likeend}</if>
<if test="istop != null"> and ISTOP ${istop.dataOp} ${istop.likestar}#{istop.value}${istop.likeend}</if>
<if test="ishot != null"> and ISHOT ${ishot.dataOp} ${ishot.likestar}#{ishot.value}${ishot.likeend}</if>
<if test="hotendtime != null"> and HOTENDTIME ${hotendtime.dataOp} ${hotendtime.likestar}#{hotendtime.value}${hotendtime.likeend}</if>
<if test="topendtime != null"> and TOPENDTIME ${topendtime.dataOp} ${topendtime.likestar}#{topendtime.value}${topendtime.likeend}</if>
<if test="clicknum != null"> and CLICKNUM ${clicknum.dataOp} ${clicknum.likestar}#{clicknum.value}${clicknum.likeend}</if>
<if test="createnuserid != null"> and CREATENUSERID ${createnuserid.dataOp} ${createnuserid.likestar}#{createnuserid.value}${createnuserid.likeend}</if>
<if test="stat != null"> and STAT ${stat.dataOp} ${stat.likestar}#{stat.value}${stat.likeend}</if>
<if test="approvalid != null"> and APPROVALID ${approvalid.dataOp} ${approvalid.likestar}#{approvalid.value}${approvalid.likeend}</if>
<if test="video != null"> and VIDEO ${video.dataOp} ${video.likestar}#{video.value}${video.likeend}</if>
<if test="iscomment != null"> and ISCOMMENT ${iscomment.dataOp} ${iscomment.likestar}#{iscomment.value}${iscomment.likeend}</if>
<if test="tags != null"> and TAGS ${tags.dataOp} ${tags.likestar}#{tags.value}${tags.likeend}</if>
<if test="opentimetype != null"> and OPENTIMETYPE ${opentimetype.dataOp} ${opentimetype.likestar}#{opentimetype.value}${opentimetype.likeend}</if>
<if test="infotime != null"> and INFOTIME ${infotime.dataOp} ${infotime.likestar}#{infotime.value}${infotime.likeend}</if>
<if test="htmlindexnum != null"> and HTMLINDEXNUM ${htmlindexnum.dataOp} ${htmlindexnum.likestar}#{htmlindexnum.value}${htmlindexnum.likeend}</if>
<if test="ordernum != null"> and ORDERNUM ${ordernum.dataOp} ${ordernum.likestar}#{ordernum.value}${ordernum.likeend}</if>
<if test="proid != null"> and PROID ${proid.dataOp} ${proid.likestar}#{proid.value}${proid.likeend}</if>
<if test="startdate != null"> and STARTDATE ${startdate.dataOp} ${startdate.likestar}#{startdate.value}${startdate.likeend}</if>
<if test="enddate != null"> and ENDDATE ${enddate.dataOp} ${enddate.likestar}#{enddate.value}${enddate.likeend}</if>
<if test="createuser != null"> and CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}</if>
<if test="createtime != null"> and CREATETIME ${createtime.dataOp} ${createtime.likestar}#{createtime.value}${createtime.likeend}</if>
<if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if>
<if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and DEPARTID in
<foreach collection="listdept.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
<if test="page != null">
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</sql>
<select id="selectSitInfoListPage" resultMap="BaseResultMap" useCache="false">
SELECT * FROM CMS_SITEINFO_TAB ${ew.customSqlSegment}
</select>
<select id="selectSitInfoListPageByDisid" resultMap="BaseResultMap">
SELECT * FROM CMS_SITEINFO_TAB info
inner join (select distinct dis.INFOID as INFOID from CMS_INFODISTIONARY_T dis
<if test="ewtwo != null">
where 1=1 <foreach item="array" index="index" open="" separator="" close="" collection="ewtwo">
<if test="index == 0">
and dis.DISTIONARYID = #{array}
</if>
<if test="index != 0">
or dis.DISTIONARYID = #{array}
</if>
</foreach>
<if test="ewtwo.length > 1">
group by dis.INFOID having count(dis.INFOID)=${ewtwo.length }
</if>
</if>
) infodi
on info.ID = infodi.INFOID
${ew.customSqlSegment}
</select>
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from CMS_SITEINFO_TAB
where id = #{id}
</select>
<update id="updateTopHotStat" parameterType="java.util.Map">
update CMS_SITEINFO_TAB
<set>
<if test="istop != null">ISTOP = #{istop},</if>
<if test="ishot != null">ISHOT = #{ishot},</if>
<if test="stat != null">STAT = #{stat},</if>
</set>
where ID IN
<foreach item="array" index="index" open="(" separator="," close=")" collection="array">#{array}</foreach>
</update>
<update id="updateChannelid" parameterType="java.util.Map">
update CMS_SITEINFO_TAB
<set>
<if test="channelid != null">CHANNELID = #{channelid},</if>
</set>
where ID IN
<foreach item="array" index="index" open="(" separator="," close=")" collection="array">#{array}</foreach>
</update>
</mapper>