Blame view

parking-module-pay/src/main/resources/mybatis/smapper/TdCActivitySMapper.xml 4.06 KB
55f68655   王彪总   新项目
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
  <?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.zteits.pay.mapper.smapper.TdCActivitySMapper">
    <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdCActivity">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="url" jdbcType="VARCHAR" property="url" />
      <result column="jump_url" jdbcType="VARCHAR" property="jumpUrl" />
      <result column="jump_type" jdbcType="INTEGER" property="jumpType" />
      <result column="jump_activity_name" jdbcType="VARCHAR" property="jumpActivityName" />
      <result column="activity_type" jdbcType="INTEGER" property="activityType" />
      <result column="remark" jdbcType="VARCHAR" property="remark" />
      <result column="is_login" jdbcType="INTEGER" property="isLogin" />
      <result column="data_state" jdbcType="INTEGER" property="dataState" />
      <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
      <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
      <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
      <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
      <result column="org_id" jdbcType="BIGINT" property="orgId" />
      <result column="org_name" jdbcType="VARCHAR" property="orgName" />
      <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
      <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
      <result column="activity_status" jdbcType="INTEGER" property="activityStatus" />
    </resultMap>
    <sql id="Base_Column_List">
       id, url, jump_url, jump_type, activity_type, jump_activity_name, remark, is_login,
      data_state, create_empid, create_date, modfiy_empid, modfiy_date, org_id, org_name,
      begin_time, end_time, activity_status
    </sql>
    <select id="selectAtcivityList" parameterType="com.zteits.clouds.api.dto.pay.param.QueryActivityByOrgIdRequest" resultMap="BaseResultMap">
      select 
      <include refid="Base_Column_List" />
      from td_c_activity
      where  data_state = 1 and activity_status = 1
      <if test="activityType != null">
        and activity_type = #{activityType,jdbcType=INTEGER}
      </if>
      <if test="activityTypeList != null and activityTypeList.size >0">
        and activity_type in
        <foreach collection="activityTypeList" item="activityType" open="(" close=")" separator=",">
          #{activityType}
        </foreach>
      </if>
      <if test="orgId != null">
        and org_id = #{orgId,jdbcType=BIGINT}
      </if>
      <if test="queryDate!=null">
        and begin_time &lt;= #{queryDate} and end_time &gt;= #{queryDate}
      </if>
  	
    </select>
    <select id="queryTdCActivityForPage" parameterType="com.zteits.clouds.api.dto.pay.param.TdCActivityQueryRequest" resultMap="BaseResultMap">
   	select
   		<include refid="Base_Column_List" />
      from td_c_activity
      where  1 = 1
      
      <!-- 上架状态-->
      <if test="activityStatus != null ">
   	 	and activity_status = #{activityStatus}
   	 </if>
   	 
   	 
   	 <!-- 生效-->
  	<if test="dataState != null and dataState == 1">
  		and begin_time &lt;= sysdate()
  		and end_time &gt;= #{nowDate}
  		and data_state = 1
  	</if>
  	<!-- 未生效-->
  	<if test="dataState != null and dataState == 0">
  		and begin_time &gt; #{nowDate}
  		and data_state = 1
  	</if>
  	<!-- 失效 -->
  	<if test="dataState != null and dataState == 2">
  		and (
  		    end_time &lt; #{nowDate}
  		 	or data_state = 0
  		 )
  	</if>
  	    <!-- 跳转类型-->
   	  <if test="activityTypes != null and activityTypes.size >0">
        and activity_type in
        <foreach collection="activityTypes" item="activityType" open="(" close=")" separator=",">
          #{activityType}
        </foreach>
      </if>
      <!-- 类型  -->
   	  <if test="jumpTypes != null and jumpTypes.size >0">
        and jump_type in
        <foreach collection="jumpTypes" item="jumpType" open="(" close=")" separator=",">
          #{jumpType}
        </foreach>
      </if>
   	 <if test="orgId != null">
        and org_id = #{orgId,jdbcType=BIGINT}
      </if>
      order by create_date desc
  </select>
  
  
  </mapper>