|
- <?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.iformall.mapper.WxMemberCardMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMemberCard">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
- <result column="card_id" jdbcType="VARCHAR" property="cardId"/>
- <result column="card_code" jdbcType="VARCHAR" property="cardCode"/>
- <result column="activate_scene" jdbcType="INTEGER" property="activateScene"/>
- <result column="outer_str" jdbcType="INTEGER" property="outerStr"/>
- <result column="open_id" jdbcType="VARCHAR" property="openId"/>
- <result column="union_id" jdbcType="VARCHAR" property="unionId"/>
- <result column="membership_number" jdbcType="VARCHAR" property="membershipNumber"/>
- <result column="level" jdbcType="VARCHAR" property="level"/>
- <result column="nickname" jdbcType="VARCHAR" property="nickname"/>
- <result column="head_image_url" jdbcType="VARCHAR" property="headImageUrl"/>
- <result column="background_picture_url" jdbcType="VARCHAR" property="backgroundPictureUrl"/>
- <result column="balance" jdbcType="INTEGER" property="balance"/>
- <result column="user_card_status" jdbcType="INTEGER" property="userCardStatus"/>
- <result column="user_information" jdbcType="VARCHAR" property="userInformation"/>
- <result column="bonus_value" jdbcType="INTEGER" property="bonusValue"/>
- <result column="service_modules" jdbcType="VARCHAR" property="serviceModules"/>
- <result column="member_price_word" jdbcType="VARCHAR" property="memberPriceWord"/>
- <result column="fapiao_jump_word" jdbcType="VARCHAR" property="fapiaoJumpWord"/>
- <result column="guide" jdbcType="VARCHAR" property="guide"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="cuser_id" jdbcType="VARCHAR" property="cuserId"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`card_id`,`card_code`,`activate_scene`,`outer_str`,`open_id`,`union_id`,
- `membership_number`,`level`,`nickname`,`head_image_url`,`background_picture_url`,`balance`,
- `user_card_status`,`user_information`,`bonus_value`,`service_modules`,`member_price_word`,`fapiao_jump_word`,
- `guide`,`update_date`,`create_date`,`cuser_id`,`user_id`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `final_tenant_id` = #{finalTenantId}
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != cardId and '' != cardId">
- and `card_id` = #{cardId}
- </if>
-
- <if test=" null != cardCode and '' != cardCode">
- and `card_code` = #{cardCode}
- </if>
-
- <if test=" null != activateScene ">
- and `activate_scene` = #{activateScene}
- </if>
-
- <if test=" null != outerStr ">
- and `outer_str` = #{outerStr}
- </if>
-
- <if test=" null != openId and '' != openId">
- and `open_id` = #{openId}
- </if>
-
- <if test=" null != unionId and '' != unionId">
- and `union_id` = #{unionId}
- </if>
-
- <if test=" null != membershipNumber and '' != membershipNumber">
- and `membership_number` = #{membershipNumber}
- </if>
-
- <if test=" null != userCardStatus ">
- and `user_card_status` = #{userCardStatus}
- </if>
-
- <if test=" null != cuserId ">
- and `cuser_id` = #{cuserId}
- </if>
-
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxMemberCard" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_member_card
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="getByCode" parameterType="com.iformall.domain.po.WxMemberCard" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_member_card
- where `final_tenant_id` = #{finalTenantId}
- and `card_id` = #{cardId}
- and `card_code` = #{cardCode}
- </select>
-
- <select id="getIdByCode" parameterType="com.iformall.domain.po.WxMemberCard" resultType="Long">
- select id from wx_member_card
- where `final_tenant_id` = #{finalTenantId}
- and `card_id` = #{cardId}
- and `card_code` = #{cardCode}
- </select>
-
- <update id="deleteByCode" parameterType="com.iformall.domain.po.WxMemberCard">
- update wx_member_card set `user_card_status` = #{userCardStatus},`update_date` = #{updateDate}
- WHERE `final_tenant_id` = #{finalTenantId}
- and `card_id` = #{cardId}
- and `card_code` = #{cardCode}
- </update>
-
- </mapper>
|