admin
2018-12-25 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?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.lable.BoutiqueAutoRuleMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule">
    <id column="sr_id" property="id" jdbcType="BIGINT"/>
    <result column="sr_source" property="source" jdbcType="INTEGER"/>
    <result column="sr_title" property="title" jdbcType="VARCHAR"/>
    <result column="sr_search_content" property="searchContent" jdbcType="VARCHAR"/>
    <result column="sr_class_name" property="className" jdbcType="VARCHAR"/>
    <result column="sr_subclass_name" property="subclassName" jdbcType="VARCHAR"/>
    <result column="sr_execute_day" property="executeDay" jdbcType="VARCHAR"/>
    <result column="sr_execute_time" property="executeTime" jdbcType="VARCHAR"/>
    <result column="sr_cron_time" property="cronTime" jdbcType="VARCHAR"/>
    <result column="sr_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="sr_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="sr_state" property="state" jdbcType="INTEGER"/>
    <result column="sr_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="sr_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">sr_id,sr_source,sr_title,sr_search_content,sr_class_name,sr_subclass_name,sr_execute_day,sr_execute_time,sr_cron_time,sr_start_time,sr_end_time,sr_state,sr_createtime,sr_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_boutique_auto_rule where sr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_boutique_auto_rule where sr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_boutique_auto_rule (sr_id,sr_source,sr_title,sr_search_content,sr_class_name,sr_subclass_name,sr_execute_day,sr_execute_time,sr_cron_time,sr_start_time,sr_end_time,sr_state,sr_createtime,sr_updatetime) values (#{id,jdbcType=BIGINT},#{source,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{searchContent,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{subclassName,jdbcType=VARCHAR},#{executeDay,jdbcType=VARCHAR},#{executeTime,jdbcType=VARCHAR},#{cronTime,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_boutique_auto_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sr_id,</if>
      <if test="source != null">sr_source,</if>
      <if test="title != null">sr_title,</if>
      <if test="searchContent != null">sr_search_content,</if>
      <if test="className != null">sr_class_name,</if>
      <if test="subclassName != null">sr_subclass_name,</if>
      <if test="executeDay != null">sr_execute_day,</if>
      <if test="executeTime != null">sr_execute_time,</if>
      <if test="cronTime != null">sr_cron_time,</if>
      <if test="startTime != null">sr_start_time,</if>
      <if test="endTime != null">sr_end_time,</if>
      <if test="state != null">sr_state,</if>
      <if test="createtime != null">sr_createtime,</if>
      <if test="updatetime != null">sr_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="source != null">#{source,jdbcType=INTEGER},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="searchContent != null">#{searchContent,jdbcType=VARCHAR},</if>
      <if test="className != null">#{className,jdbcType=VARCHAR},</if>
      <if test="subclassName != null">#{subclassName,jdbcType=VARCHAR},</if>
      <if test="executeDay != null">#{executeDay,jdbcType=VARCHAR},</if>
      <if test="executeTime != null">#{executeTime,jdbcType=VARCHAR},</if>
      <if test="cronTime != null">#{cronTime,jdbcType=VARCHAR},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</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.lable.BoutiqueAutoRule">update yeshi_ec_boutique_auto_rule set sr_source = #{source,jdbcType=INTEGER},sr_title = #{title,jdbcType=VARCHAR},sr_search_content = #{searchContent,jdbcType=VARCHAR},sr_class_name = #{className,jdbcType=VARCHAR},sr_subclass_name = #{subclassName,jdbcType=VARCHAR},sr_execute_day = #{executeDay,jdbcType=VARCHAR},sr_execute_time = #{executeTime,jdbcType=VARCHAR},sr_cron_time = #{cronTime,jdbcType=VARCHAR},sr_start_time = #{startTime,jdbcType=TIMESTAMP},sr_end_time = #{endTime,jdbcType=TIMESTAMP},sr_state = #{state,jdbcType=INTEGER},sr_createtime = #{createtime,jdbcType=TIMESTAMP},sr_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule">update yeshi_ec_boutique_auto_rule
    <set>
      <if test="source != null">sr_source=#{source,jdbcType=INTEGER},</if>
      <if test="title != null">sr_title=#{title,jdbcType=VARCHAR},</if>
      <if test="searchContent != null">sr_search_content=#{searchContent,jdbcType=VARCHAR},</if>
      <if test="className != null">sr_class_name=#{className,jdbcType=VARCHAR},</if>
      <if test="subclassName != null">sr_subclass_name=#{subclassName,jdbcType=VARCHAR},</if>
      <if test="executeDay != null">sr_execute_day=#{executeDay,jdbcType=VARCHAR},</if>
      <if test="executeTime != null">sr_execute_time=#{executeTime,jdbcType=VARCHAR},</if>
      <if test="cronTime != null">sr_cron_time=#{cronTime,jdbcType=VARCHAR},</if>
      <if test="startTime != null">sr_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">sr_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">sr_state=#{state,jdbcType=INTEGER},</if>
      <if test="createtime != null">sr_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">sr_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where sr_id = #{id,jdbcType=BIGINT}
  </update>
  
   <select id="query" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_boutique_auto_rule
        WHERE     <![CDATA[1>0]]>
           <if test='source != null'>
                  AND sr_source = #{source}
           </if>
            <if test='key != null and key != "" '>
                  AND sr_title like '%${key}%'
            </if>
             <if test='state != null'>
                  AND sr_state = #{state}
            </if>
        ORDER BY 
         <if test='sort == 1'>
                  sr_execute_time, 
         </if>
         <if test='sort == 2'>
                  sr_execute_time DESC,
         </if>
         <if test='sort == 3'>
                  sr_updatetime,
         </if>
         <if test='sort == 4'>
                  sr_updatetime DESC,
         </if>
          sr_createtime DESC 
        
        LIMIT ${start},${count}
   </select>
 
   <select id="queryCount" resultType="java.lang.Long">
           SELECT count(sr_id)  FROM yeshi_ec_boutique_auto_rule
        WHERE     <![CDATA[1>0]]>
           <if test='source != null'>
                  AND sr_source = #{source}
           </if>
           <if test='key != null and key != "" '>
                  AND sr_title like '%${key}%'
            </if>
            <if test='state != null'>
                  AND sr_state = #{state}
            </if>
    </select>
  
    <select id="queryStart" resultMap="BaseResultMap">
        <!-- 查询所有启用任务 -->
        SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_boutique_auto_rule
        WHERE  sr_state = 1
    </select>
  
</mapper>