| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- <?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.slodon.b2b2c.dao.write.live.LiveBroadWriteMapper">
- <resultMap id="resultMap" type="com.slodon.b2b2c.live.pojo.LiveBroadcast">
- <id column="roomId" property="roomId" />
- <result column="name" property="name" />
- <result column="name" property="name" />
- <result column="coverImg" property="coverImg" />
- <result column="startTime" property="startTime" />
- <result column="endTime" property="endTime" />
- <result column="anchorName" property="anchorName" />
- <result column="anchorWechat" property="anchorWechat" />
- <result column="subAnchorWechat" property="subAnchorWechat" />
- <result column="createrWechat" property="createrWechat" />
- <result column="shareImg" property="shareImg" />
- <result column="feedsImg" property="feedsImg" />
- <result column="isFeedsPublic" property="isFeedsPublic" />
- <result column="type" property="type" />
- <result column="closeLike" property="closeLike" />
- <result column="closeGoods" property="closeGoods" />
- <result column="closeComment" property="closeComment" />
- <result column="closeReplay" property="closeReplay" />
- <result column="closeShare" property="closeShare" />
- <result column="closeKf" property="closeKf" />
- </resultMap>
- <!--除主键外的所有字段,用于插入操作-->
- <sql id="columns">
- <trim suffixOverrides=",">
- <if test="roomId != null">
- roomId,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="coverImg != null">
- coverImg,
- </if>
- <if test="startTime != null">
- startTime,
- </if>
- <if test="endTime != null">
- endTime,
- </if>
- <if test="anchorName != null">
- anchorName,
- </if>
- <if test="anchorWechat != null">
- anchorWechat,
- </if>
- <if test="subAnchorWechat != null">
- subAnchorWechat,
- </if>
- <if test="createrWechat != null">
- createrWechat,
- </if>
- <if test="shareImg != null">
- shareImg,
- </if>
- <if test="feedsImg != null">
- feedsImg,
- </if>
- <if test="isFeedsPublic != null">
- isFeedsPublic,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="closeLike != null">
- closeLike,
- </if>
- <if test="closeGoods != null">
- closeGoods,
- </if>
- <if test="closeComment != null">
- closeComment,
- </if>
- <if test="closeReplay != null">
- closeReplay,
- </if>
- <if test="closeShare != null">
- closeShare,
- </if>
- <if test="closeKf != null">
- closeKf,
- </if>
- </trim>
- </sql>
- <!--按照主键值进行操作-->
- <sql id="pkWhere">
- WHERE roomId = #{primaryKey}
- </sql>
- <!--操作条件-->
- <sql id="whereCondition">
- <if test="example != null">
- <trim prefix="WHERE" prefixOverrides="AND|OR">
- <if test="example.roomId != null">
- AND roomId = ${example.roomId}
- </if>
- <if test="example.name != null">
- AND name like concat('%',#{example.name},'%')
- </if>
- <if test="example.coverImg != null">
- AND coverImg = ${example.coverImg}
- </if>
- <if test="example.startTime != null">
- AND startTime = ${example.startTime}
- </if>
- <if test="example.endTime != null">
- AND endTime = ${example.endTime}
- </if>
- <if test="example.anchorName != null">
- AND anchorName = ${example.anchorName}
- </if>
- <if test="example.anchorWechat != null">
- AND anchorWechat = ${example.anchorWechat}
- </if>
- <if test="example.subAnchorWechat != null">
- AND subAnchorWechat = ${example.subAnchorWechat}
- </if>
- <if test="example.createrWechat != null">
- AND createrWechat = ${example.createrWechat}
- </if>
- <if test="example.shareImg != null">
- AND shareImg = ${example.shareImg}
- </if>
- <if test="example.feedsImg != null">
- AND feedsImg = ${example.feedsImg}
- </if>
- <if test="example.isFeedsPublic != null">
- AND isFeedsPublic = ${example.isFeedsPublic}
- </if>
- <if test="example.type != null">
- AND type = ${example.type}
- </if>
- <if test="example.closeLike != null">
- AND closeLike = ${example.closeLike}
- </if>
- <if test="example.closeGoods != null">
- AND closeGoods = ${example.closeGoods}
- </if>
- <if test="example.closeComment != null">
- AND closeComment = ${example.closeComment}
- </if>
- <if test="example.closeReplay != null">
- AND closeReplay = ${example.closeReplay}
- </if>
- <if test="example.closeShare != null">
- AND closeShare = ${example.closeShare}
- </if>
- <if test="example.closeKf != null">
- AND closeKf = ${example.closeKf}
- </if>
- </trim>
- </if>
- </sql>
- <!--排序条件-->
- <sql id="orderBy">
- ORDER BY roomId DESC
- </sql>
- <sql id="orderByOther">
- order by ${example.orderBy}
- </sql>
- <!--分组条件-->
- <sql id="groupBy">
- group by ${example.groupBy}
- </sql>
- <!--分页条件-->
- <sql id="limit">
- <if test="size != null and size > 0">
- limit #{startRow},#{size}
- </if>
- </sql>
- <!--查询符合条件的记录数-->
- <select id="countByExample" parameterType="com.slodon.b2b2c.live.example.LiveBroadcastExample" resultType="java.lang.Integer">
- SELECT
- COUNT(*)
- FROM live_broadcast
- <include refid="whereCondition" />
- </select>
- <!--根据主键查询记录-->
- <select id="getByPrimaryKey" resultMap="resultMap">
- SELECT
- *
- FROM live_broadcast
- <include refid="pkWhere" />
- </select>
- <!--查询符合条件的记录(所有字段)-->
- <select id="listByExample" resultMap="resultMap">
- SELECT
- *
- FROM live_broadcast
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- </select>
- <!--分页查询符合条件的记录(所有字段)-->
- <select id="listPageByExample" resultMap="resultMap">
- SELECT
- *
- FROM live_broadcast
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- <include refid="limit" />
- </select>
- <!--查询符合条件的记录(指定字段)-->
- <select id="listFieldsByExample" resultMap="resultMap">
- SELECT
- ${fields}
- FROM live_broadcast
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- </select>
- <!--分页查询符合条件的记录(指定字段)-->
- <select id="listFieldsPageByExample" resultMap="resultMap">
- SELECT
- ${fields}
- FROM live_broadcast
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- <include refid="limit" />
- </select>
- <!--根据条件删除记录,可多条删除-->
- <delete id="deleteByExample">
- DELETE FROM live_broadcast
- <include refid="whereCondition" />
- </delete>
- <!--根据主键删除记录-->
- <delete id="deleteByPrimaryKey">
- DELETE FROM live_broadcast
- <include refid="pkWhere" />
- </delete>
- <!--插入一条记录-->
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.slodon.b2b2c.live.pojo.LiveBroadcast" useGeneratedKeys="true">
- INSERT INTO live_broadcast(
- <include refid="columns" />
- )
- VALUES(
- <trim suffixOverrides=",">
- <if test="roomId != null">
- ${roomId},
- </if>
- <if test="name != null">
- ${name},
- </if>
- <if test="coverImg != null">
- ${coverImg},
- </if>
- <if test="startTime != null">
- ${startTime},
- </if>
- <if test="endTime != null">
- ${endTime},
- </if>
- <if test="anchorName != null">
- ${anchorName},
- </if>
- <if test="anchorWechat != null">
- ${anchorWechat},
- </if>
- <if test="subAnchorWechat != null">
- ${subAnchorWechat},
- </if>
- <if test="createrWechat != null">
- ${createrWechat},
- </if>
- <if test="shareImg != null">
- ${shareImg},
- </if>
- <if test="feedsImg != null">
- ${feedsImg},
- </if>
- <if test="isFeedsPublic != null">
- ${isFeedsPublic},
- </if>
- <if test="type != null">
- ${type},
- </if>
- <if test="closeLike != null">
- ${closeLike},
- </if>
- <if test="closeGoods != null">
- ${closeGoods},
- </if>
- <if test="closeComment != null">
- ${closeComment},
- </if>
- <if test="closeReplay != null">
- ${closeReplay},
- </if>
- <if test="closeShare != null">
- ${closeShare},
- </if>
- <if test="closeKf != null">
- ${closeKf},
- </if>
- </trim>
- )
- </insert>
- <!--按条件更新记录中不为空的字段-->
- <update id="updateByExampleSelective">
- UPDATE live_broadcast
- <trim prefix="SET" suffixOverrides=",">
- <if test="record.roomId != null">
- AND roomId = #{record.roomId},
- </if>
- <if test="record.name != null">
- AND name = #{record.name},
- </if>
- <if test="record.coverImg != null">
- AND coverImg = #{record.coverImg},
- </if>
- <if test="record.startTime != null">
- AND startTime = #{record.startTime},
- </if>
- <if test="record.endTime != null">
- AND endTime = #{record.endTime},
- </if>
- <if test="record.anchorName != null">
- AND anchorName = #{record.anchorName},
- </if>
- <if test="record.anchorWechat != null">
- AND anchorWechat = #{record.anchorWechat},
- </if>
- <if test="record.subAnchorWechat != null">
- AND subAnchorWechat = #{record.subAnchorWechat},
- </if>
- <if test="record.createrWechat != null">
- AND createrWechat = #{record.createrWechat},
- </if>
- <if test="record.shareImg != null">
- AND shareImg = #{record.shareImg},
- </if>
- <if test="record.feedsImg != null">
- AND feedsImg = #{record.feedsImg},
- </if>
- <if test="record.isFeedsPublic != null">
- AND isFeedsPublic = #{record.isFeedsPublic},
- </if>
- <if test="record.type != null">
- AND type = #{record.type},
- </if>
- <if test="record.closeLike != null">
- AND closeLike = #{record.closeLike},
- </if>
- <if test="record.closeGoods != null">
- AND closeGoods = #{record.closeGoods},
- </if>
- <if test="record.closeComment != null">
- AND closeComment = #{record.closeComment},
- </if>
- <if test="record.closeReplay != null">
- AND closeReplay = #{record.closeReplay},
- </if>
- <if test="record.closeShare != null">
- AND closeShare = #{record.closeShare},
- </if>
- <if test="record.closeKf != null">
- AND closeKf = #{record.closeKf},
- </if>
- </trim>
- <include refid="whereCondition" />
- </update>
- <!--按照主键更新记录中不为空的字段-->
- <update id="updateByPrimaryKeySelective">
- UPDATE live_broadcast
- <trim prefix="SET" suffixOverrides=",">
- <if test="roomId != null">
- roomId = #{roomId}
- </if>
- <if test="name != null">
- name = #{name}
- </if>
- <if test="coverImg != null">
- coverImg = #{coverImg}
- </if>
- <if test="startTime != null">
- startTime = #{startTime}
- </if>
- <if test="endTime != null">
- endTime = #{endTime}
- </if>
- <if test="anchorName != null">
- anchorName = #{anchorName}
- </if>
- <if test="anchorWechat != null">
- anchorWechat = #{anchorWechat}
- </if>
- <if test="subAnchorWechat != null">
- subAnchorWechat = #{subAnchorWechat}
- </if>
- <if test="createrWechat != null">
- createrWechat = #{createrWechat}
- </if>
- <if test="shareImg != null">
- shareImg = #{shareImg}
- </if>
- <if test="feedsImg != null">
- feedsImg = #{feedsImg}
- </if>
- <if test="isFeedsPublic != null">
- isFeedsPublic = #{isFeedsPublic}
- </if>
- <if test="type != null">
- type = #{type}
- </if>
- <if test="closeLike != null">
- closeLike = #{closeLike}
- </if>
- <if test="closeGoods != null">
- closeGoods = #{closeGoods}
- </if>
- <if test="closeComment != null">
- closeComment = #{closeComment}
- </if>
- <if test="closeReplay != null">
- closeReplay = #{closeReplay}
- </if>
- <if test="closeShare != null">
- closeShare = #{closeShare}
- </if>
- <if test="closeKf != null">
- closeKf = #{closeKf}
- </if>
- </trim>
- WHERE roomId = #{roomId}
- </update>
- </mapper>
|