| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <?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.kede.common.dao.ProjectMapper">
- <resultMap id="BaseResultMap" type="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="amount" jdbcType="DECIMAL" property="amount" />
- <result column="thumbnail_url" jdbcType="VARCHAR" property="thumbnailUrl" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="sort" jdbcType="INTEGER" property="sort" />
- <result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" />
- <result column="host" jdbcType="INTEGER" property="host" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="commodity_url" jdbcType="VARCHAR" property="commodityUrl" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- <result column="content" jdbcType="LONGVARCHAR" property="content" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- id, `name`, amount, thumbnail_url, `status`, sort, release_status, create_time, release_time,
- `host`, `type`, commodity_url
- </sql>
- <sql id="Blob_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- content
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from project
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- delete from project
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- insert into project (id, `name`, amount,
- thumbnail_url, `status`, sort,
- release_status, create_time, release_time,
- `host`, `type`, commodity_url,
- content)
- values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL},
- #{thumbnailUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
- #{releaseStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{releaseTime,jdbcType=TIMESTAMP},
- #{host,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{commodityUrl,jdbcType=VARCHAR},
- #{content,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- insert into project
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="name != null">
- `name`,
- </if>
- <if test="amount != null">
- amount,
- </if>
- <if test="thumbnailUrl != null">
- thumbnail_url,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="sort != null">
- sort,
- </if>
- <if test="releaseStatus != null">
- release_status,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="releaseTime != null">
- release_time,
- </if>
- <if test="host != null">
- `host`,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="commodityUrl != null">
- commodity_url,
- </if>
- <if test="content != null">
- content,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DECIMAL},
- </if>
- <if test="thumbnailUrl != null">
- #{thumbnailUrl,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="sort != null">
- #{sort,jdbcType=INTEGER},
- </if>
- <if test="releaseStatus != null">
- #{releaseStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="releaseTime != null">
- #{releaseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="host != null">
- #{host,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="commodityUrl != null">
- #{commodityUrl,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- #{content,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- update project
- <set>
- <if test="name != null">
- `name` = #{name,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DECIMAL},
- </if>
- <if test="thumbnailUrl != null">
- thumbnail_url = #{thumbnailUrl,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="sort != null">
- sort = #{sort,jdbcType=INTEGER},
- </if>
- <if test="releaseStatus != null">
- release_status = #{releaseStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="releaseTime != null">
- release_time = #{releaseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="host != null">
- `host` = #{host,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="commodityUrl != null">
- commodity_url = #{commodityUrl,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- update project
- set `name` = #{name,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- thumbnail_url = #{thumbnailUrl,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- sort = #{sort,jdbcType=INTEGER},
- release_status = #{releaseStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- release_time = #{releaseTime,jdbcType=TIMESTAMP},
- `host` = #{host,jdbcType=INTEGER},
- `type` = #{type,jdbcType=INTEGER},
- commodity_url = #{commodityUrl,jdbcType=VARCHAR},
- content = #{content,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.kede.common.model.Project">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Mon Apr 12 17:24:38 CST 2021.
- -->
- update project
- set `name` = #{name,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- thumbnail_url = #{thumbnailUrl,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- sort = #{sort,jdbcType=INTEGER},
- release_status = #{releaseStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- release_time = #{releaseTime,jdbcType=TIMESTAMP},
- `host` = #{host,jdbcType=INTEGER},
- `type` = #{type,jdbcType=INTEGER},
- commodity_url = #{commodityUrl,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectProjectList" resultType="com.kede.common.model.projectBo">
- select a.id,a.name,a.amount,a.thumbnail_url thumbnailUrl,a.status,a.sort,a.content,a.release_status releaseStatus,
- a.host,a.commodity_url commodityUrl ,b.name typeName,a.`type` ,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes, date_format(a.release_time,'%Y-%m-%d %H:%i:%S')releaseTimes
- from project a left join project_type b on a.`type` =b.id where 1=1
- <if test="name != null">
- and a.name like concat('%',#{name},'%')
- </if>
- <if test="releaseStatus != null">
- and a.release_status = #{releaseStatus}
- </if>
- <if test="host != null">
- and a.host = #{host}
- </if>
- <if test="startTime != null and endTime !=null">
- and a.create_time between #{startTime} and #{endTime}
- </if>
- <if test="page_sql !=null">
- ${page_sql}
- </if>
- </select>
- <select id="selectProjectCount" resultType="java.lang.Integer">
- select count(*)
- from project where 1=1
- <if test="name != null">
- and name like concat('%',#{name},'%')
- </if>
- <if test="releaseStatus != null">
- and a.release_status = #{releaseStatus}
- </if>
- <if test="host != null">
- and a.host = #{host}
- </if>
- <if test="startTime != null and endTime !=null">
- and create_time between #{startTime} and #{endTime}
- </if>
- </select>
- <select id="getProject" parameterType="java.lang.Integer" resultType="com.kede.common.model.projectBo">
- select a.id,a.name,a.amount,a.thumbnail_url thumbnailUrl,a.status,a.sort,a.content,a.release_status releaseStatus,
- a.host,a.commodity_url commodityUrl ,b.name typeName,a.`type` ,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes, date_format(a.release_time,'%Y-%m-%d %H:%i:%S')releaseTimes
- from project a left join project_type b on a.`type` =b.id where 1=1
- and a.id = #{id,jdbcType=INTEGER}
- </select>
- </mapper>
|