|
- <?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.AliPayCUserMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.AliPayCUser">
- <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="name" jdbcType="VARCHAR" property="name"/>
- <result column="alipay_user_id" jdbcType="VARCHAR" property="alipayUserId"/>
- <result column="phone" jdbcType="VARCHAR" property="phone"/>
- <result column="card_open" jdbcType="INTEGER" property="cardOpen"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`name`,`alipay_user_id`,`phone`,`card_open`,`user_id`,`update_date`,`create_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1=1
-
- <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 != name ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != alipayUserId ">
- and `alipay_user_id` = #{alipayUserId}
- </if>
-
- <if test=" null != phone ">
- and `phone` = #{phone}
- </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.AliPayCUser" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from alipay_c_user
- <include refid="dynamicWhereConditions"/>
- and id > 1
- </select>
-
-
- <select id="findByAliPayUserId" parameterType="com.iformall.domain.po.AliPayCUser" resultMap="BaseResultMap">
- select <include refid="allColumns"/> from alipay_c_user
- where `alipay_user_id` = #{alipayUserId} and `tenant_id` = #{tenantId}
- </select>
-
- <update id="updateUserId" parameterType="com.iformall.domain.po.AliPayCUser">
- update alipay_c_user set user_id=#{userId}
- where id = #{id} and `tenant_id` = #{tenantId}
- </update>
-
- </mapper>
|