123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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.jeeplus.modules.base.mapper.EduVideoNewsMapper">
-
- <sql id="eduVideoNewsColumns">
- a.id AS "id",
- a.type_id AS "typeId",
- a.cover AS "cover",
- a.title AS "title",
- a.url1 AS "url1",
- a.url2 AS "url2",
- a.url3 AS "url3",
- a.source AS "source",
- a.contents AS "contents",
- a.create_by AS "createBy.id",
- a.create_date AS "createDate",
- a.update_by AS "updateBy.id",
- a.update_date AS "updateDate",
- a.del_flag AS "delFlag",
- a.is_top AS "isTop",
- a.score AS "score",
- a.score_type AS "scoreType"
- </sql>
-
- <sql id="eduVideoNewsJoins">
-
- </sql>
-
- <resultMap type="EduVideoNews" id="EduVideoNewsResult" autoMapping="true">
- <result column="contents" property="contents" typeHandler="com.jeeplus.core.mapper.ConvertBlobTypeHandler"/>
- </resultMap>
-
- <select id="get" resultMap="EduVideoNewsResult" >
- SELECT
- <include refid="eduVideoNewsColumns"/>
- FROM edu_video_news a
- <include refid="eduVideoNewsJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultMap="EduVideoNewsResult" >
- SELECT
- <include refid="eduVideoNewsColumns"/>
- FROM edu_video_news a
- <include refid="eduVideoNewsJoins"/>
- <where>
- a.del_flag = #{DEL_FLAG_NORMAL}
- ${dataScope}
- <if test="title != null and title != ''">
- AND a.title LIKE concat('%',#{title},'%')
- </if>
- <if test="typeId != null and typeId != ''">
- AND a.type_id = #{typeId}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <when test="orderBy !=null and orderBy != ''">
- ORDER BY ${orderBy}
- </when>
- <otherwise>
- ORDER BY a.update_date DESC
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultMap="EduVideoNewsResult" >
- SELECT
- <include refid="eduVideoNewsColumns"/>
- FROM edu_video_news a
- <include refid="eduVideoNewsJoins"/>
- <where>
- a.del_flag = #{DEL_FLAG_NORMAL}
- ${dataScope}
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.update_date DESC
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert">
- INSERT INTO edu_video_news(
- id,
- type_id,
- cover,
- title,
- url1,
- url2,
- url3,
- source,
- contents,
- create_by,
- create_date,
- update_by,
- update_date,
- del_flag,
- is_top,
- score,
- score_type
- ) VALUES (
- #{id},
- #{typeId},
- #{cover},
- #{title},
- #{url1},
- #{url2},
- #{url3},
- #{source},
- #{contents},
- #{createBy.id},
- #{createDate},
- #{updateBy.id},
- #{updateDate},
- #{delFlag},
- #{isTop},
- #{score},
- #{scoreType}
- )
- </insert>
-
- <update id="update">
- UPDATE edu_video_news SET
- type_id = #{typeId},
- cover = #{cover},
- title = #{title},
- url1 = #{url1},
- url2 = #{url2},
- url3 = #{url3},
- source = #{source},
- contents = #{contents},
- update_by = #{updateBy.id},
- update_date = #{updateDate},
- is_top = #{isTop},
- score = #{score},
- score_type = #{scoreType}
- WHERE id = #{id}
- </update>
-
-
- <!--物理删除-->
- <update id="delete">
- DELETE FROM edu_video_news
- WHERE id = #{id}
- </update>
-
- <!--逻辑删除-->
- <update id="deleteByLogic">
- UPDATE edu_video_news SET
- del_flag = #{DEL_FLAG_DELETE}
- WHERE id = #{id}
- </update>
-
-
- <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
- <select id="findUniqueByProperty" resultType="EduVideoNews" statementType="STATEMENT">
- select * FROM edu_video_news where ${propertyName} = '${value}'
- </select>
-
- </mapper>
|