|
- <?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.MallCooUserInfoMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallCooUserInfo">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="open_user_id" jdbcType="VARCHAR" property="openUserId"/>
- <result column="phone" jdbcType="VARCHAR" property="phone"/>
- <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
- <result column="gender" jdbcType="INTEGER" property="gender"/>
- <result column="address" jdbcType="VARCHAR" property="address"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <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="user_name" jdbcType="VARCHAR" property="userName"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`open_user_id`,`phone`,`birthdate`,`gender`,
- `address`,`create_date`,`update_date`,
- `final_tenant_id`,`tenant_id`,`parent_tenant_id`,`user_name`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `final_tenant_id` = #{finalTenantId}
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != phone ">
- and `phone` like concat('%', #{phone},'%')
- </if>
-
- <if test=" null != birthdate ">
- and `birthdate` = #{birthdate}
- </if>
-
- <if test=" null != gender ">
- and `gender` = #{gender}
- </if>
-
- <if test=" null != address ">
- and `address` like concat('%', #{address},'%')
- </if>
-
- <if test=" null != userName ">
- and `user_name` like concat('%', #{userName},'%')
- </if>
- <if test=" null != startTime and null != endTime">
- and `create_date` between #{startTime} and #{endTime}
- </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="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select <include refid="allColumns"/>
- from mall_coo_user_info
- where id =#{id}
- and final_tenant_id = #{finalTenantId}
- </select>
-
-
- <select id="findList" parameterType="com.iformall.domain.po.MallCooUserInfo" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from mall_coo_user_info
- <include refid="dynamicWhereConditions"/>
- </select>
-
- </mapper>
|