admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
@@ -1,99 +1,150 @@
<?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.yeshi.fanli.dao.mybatis.help.AppPageNotificationMapper">
   <resultMap id="BaseResultMap"
      type="com.yeshi.fanli.entity.bus.help.AppPageNotification">
      <id column="an_id" property="id" jdbcType="BIGINT" />
      <result column="an_type" property="type"
         typeHandler="com.yeshi.fanli.util.mybatishandler.AppPageNotificationTypeEnumHandler" />
      <result column="an_show" property="show" jdbcType="BOOLEAN" />
      <result column="an_can_close" property="canClose" jdbcType="BOOLEAN" />
      <result column="an_content" property="content" jdbcType="VARCHAR" />
      <result column="an_content_url" property="contentUrl" jdbcType="VARCHAR" />
      <result column="an_md5" property="md5" jdbcType="VARCHAR" />
      <result column="an_createtime" property="createTime" jdbcType="TIMESTAMP" />
      <result column="an_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Base_Column_List">an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_updatetime
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_apppage_notification where an_id = #{id,jdbcType=BIGINT}
   </select>
   <select id="selectByType" resultMap="BaseResultMap"
      parameterType="java.lang.String">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_apppage_notification where an_type = #{0}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_apppage_notification where an_id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
      useGeneratedKeys="true" keyProperty="id">insert into
      yeshi_ec_apppage_notification
      (an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_updatetime)
      values
      (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{show,jdbcType=BOOLEAN},#{canClose,jdbcType=BOOLEAN},#{content,jdbcType=VARCHAR},#{contentUrl,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
      useGeneratedKeys="true" keyProperty="id">
      insert into yeshi_ec_apppage_notification
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">an_id,</if>
         <if test="type != null">an_type,</if>
         <if test="show != null">an_show,</if>
         <if test="canClose != null">an_can_close,</if>
         <if test="content != null">an_content,</if>
         <if test="contentUrl != null">an_content_url,</if>
         <if test="md5 != null">an_md5,</if>
         <if test="createTime != null">an_createtime,</if>
         <if test="updateTime != null">an_updatetime,</if>
      </trim>
      values
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">#{id,jdbcType=BIGINT},</if>
         <if test="type != null">#{type,jdbcType=VARCHAR},</if>
         <if test="show != null">#{show,jdbcType=BOOLEAN},</if>
         <if test="canClose != null">#{canClose,jdbcType=BOOLEAN},</if>
         <if test="content != null">#{content,jdbcType=VARCHAR},</if>
         <if test="contentUrl != null">#{contentUrl,jdbcType=VARCHAR},</if>
         <if test="md5 != null">#{md5,jdbcType=VARCHAR},</if>
         <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
      </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">update
      yeshi_ec_apppage_notification set an_type =
      #{type,jdbcType=VARCHAR},an_show =
      #{show,jdbcType=BOOLEAN},an_can_close =
      #{canClose,jdbcType=BOOLEAN},an_content =
      #{content,jdbcType=VARCHAR},an_content_url =
      #{contentUrl,jdbcType=VARCHAR},an_md5 =
      #{md5,jdbcType=VARCHAR},an_createtime =
      #{createTime,jdbcType=TIMESTAMP},an_updatetime =
      #{updateTime,jdbcType=TIMESTAMP} where an_id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">
      update yeshi_ec_apppage_notification
      <set>
         <if test="type != null">an_type=#{type,jdbcType=VARCHAR},</if>
         <if test="show != null">an_show=#{show,jdbcType=BOOLEAN},</if>
         <if test="canClose != null">an_can_close=#{canClose,jdbcType=BOOLEAN},</if>
         <if test="content != null">an_content=#{content,jdbcType=VARCHAR},</if>
         <if test="contentUrl != null">an_content_url=#{contentUrl,jdbcType=VARCHAR},</if>
         <if test="md5 != null">an_md5=#{md5,jdbcType=VARCHAR},</if>
         <if test="createTime != null">an_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">an_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
      </set>
      where an_id = #{id,jdbcType=BIGINT}
   </update>
</mapper>
<?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.yeshi.fanli.dao.mybatis.help.AppPageNotificationMapper">
   <resultMap id="BaseResultMap"
      type="com.yeshi.fanli.entity.bus.help.AppPageNotification">
      <id column="an_id" property="id" jdbcType="BIGINT" />
      <result column="an_type" property="type"
         typeHandler="com.yeshi.fanli.util.mybatishandler.AppPageNotificationTypeEnumHandler" />
      <result column="an_show" property="show" jdbcType="BOOLEAN" />
      <result column="an_can_close" property="canClose" jdbcType="BOOLEAN" />
      <result column="an_content" property="content" jdbcType="VARCHAR" />
      <result column="an_content_url" property="contentUrl" jdbcType="VARCHAR" />
      <result column="an_md5" property="md5" jdbcType="VARCHAR" />
      <result column="an_createtime" property="createTime" jdbcType="TIMESTAMP" />
      <result column="an_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
      <result column="an_begin_time" property="beginTime" jdbcType="TIMESTAMP"/>
         <result column="an_end_time" property="endTime" jdbcType="TIMESTAMP"/>
   </resultMap>
   <sql id="Base_Column_List">an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_apppage_notification where an_id = #{id,jdbcType=BIGINT}
   </select>
   <select id="selectByType" resultMap="BaseResultMap"
      parameterType="java.lang.String">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_apppage_notification where an_type = #{0}
   </select>
   <select id="listValidByType" resultMap="BaseResultMap" parameterType="java.lang.String">
      SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_apppage_notification
      WHERE an_type = #{0} AND an_show = 1
          AND IF(an_begin_time IS NULL,TRUE, an_begin_time<![CDATA[<=]]> NOW())
           AND IF(an_end_time IS NULL,TRUE, an_end_time <![CDATA[>=]]> NOW())
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_apppage_notification where an_id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
      useGeneratedKeys="true" keyProperty="id">insert into
      yeshi_ec_apppage_notification
      (an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime)
      values
      (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{show,jdbcType=BOOLEAN},#{canClose,jdbcType=BOOLEAN},#{content,jdbcType=VARCHAR},#{contentUrl,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beginTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
      useGeneratedKeys="true" keyProperty="id">
      insert into yeshi_ec_apppage_notification
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">an_id,</if>
         <if test="type != null">an_type,</if>
         <if test="show != null">an_show,</if>
         <if test="canClose != null">an_can_close,</if>
         <if test="content != null">an_content,</if>
         <if test="contentUrl != null">an_content_url,</if>
         <if test="md5 != null">an_md5,</if>
         <if test="createTime != null">an_createtime,</if>
          <if test="beginTime != null">an_begin_time,</if>
           <if test="endTime != null">an_end_time,</if>
         <if test="updateTime != null">an_updatetime,</if>
      </trim>
      values
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">#{id,jdbcType=BIGINT},</if>
         <if test="type != null">#{type,jdbcType=VARCHAR},</if>
         <if test="show != null">#{show,jdbcType=BOOLEAN},</if>
         <if test="canClose != null">#{canClose,jdbcType=BOOLEAN},</if>
         <if test="content != null">#{content,jdbcType=VARCHAR},</if>
         <if test="contentUrl != null">#{contentUrl,jdbcType=VARCHAR},</if>
         <if test="md5 != null">#{md5,jdbcType=VARCHAR},</if>
         <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="beginTime != null">#{beginTime,jdbcType=TIMESTAMP},</if>
           <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
      </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">update
      yeshi_ec_apppage_notification set an_type =
      #{type,jdbcType=VARCHAR},an_show =
      #{show,jdbcType=BOOLEAN},an_can_close =
      #{canClose,jdbcType=BOOLEAN},an_content =
      #{content,jdbcType=VARCHAR},an_content_url =
      #{contentUrl,jdbcType=VARCHAR},an_md5 =
      #{md5,jdbcType=VARCHAR},an_createtime =
      #{createTime,jdbcType=TIMESTAMP},an_begin_time = #{beginTime,jdbcType=TIMESTAMP},an_end_time = #{endTime,jdbcType=TIMESTAMP},an_updatetime =
      #{updateTime,jdbcType=TIMESTAMP} where an_id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">
      update yeshi_ec_apppage_notification
      <set>
         <if test="type != null">an_type=#{type,jdbcType=VARCHAR},</if>
         <if test="show != null">an_show=#{show,jdbcType=BOOLEAN},</if>
         <if test="canClose != null">an_can_close=#{canClose,jdbcType=BOOLEAN},</if>
         <if test="content != null">an_content=#{content,jdbcType=VARCHAR},</if>
         <if test="contentUrl != null">an_content_url=#{contentUrl,jdbcType=VARCHAR},</if>
         <if test="md5 != null">an_md5=#{md5,jdbcType=VARCHAR},</if>
         <if test="createTime != null">an_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="beginTime != null">an_begin_time=#{beginTime,jdbcType=TIMESTAMP},</if>
           <if test="endTime != null">an_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">an_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
      </set>
      where an_id = #{id,jdbcType=BIGINT}
   </update>
   <select id="listQuery" resultMap="BaseResultMap">
       SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_apppage_notification
       WHERE 1=1
         <if test='key != null and key != ""'>
               AND (an_type like '%${key}%' or an_content like '%${key}%')
         </if>
         <if test='show != null'>
               AND an_show = #{show}
         </if>
         <if test='canClose != null'>
               AND an_can_close = #{canClose}
         </if>
         ORDER BY an_createtime desc
       LIMIT ${start},${count}
   </select>
   <select id="countQuery" resultType="java.lang.Long">
       SELECT IFNULL(count(an_id),0)  FROM yeshi_ec_apppage_notification
       WHERE 1=1
          <if test='key != null and key != ""'>
               AND (an_type like '%${key}%' or an_content like '%${key}%')
         </if>
         <if test='show != null'>
               AND an_show = #{show}
         </if>
         <if test='canClose != null'>
               AND an_can_close = #{canClose}
         </if>
   </select>
     <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
      delete from yeshi_ec_apppage_notification WHERE an_id in
      <foreach collection="list" item="item" open="(" close=")"
         separator=",">#{item}</foreach>
    </delete>
</mapper>