|
- <?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.UserBasicFromMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.UserBasicFrom">
- <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="from_project" jdbcType="INTEGER" property="fromProject" />
- <result column="from_type" jdbcType="INTEGER" property="fromType" />
- <result column="from_id" jdbcType="BIGINT" property="fromId" />
- <result column="from_user_id" jdbcType="BIGINT" property="fromUserId" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,
- `from_project`,`from_type`,`from_id`,`from_user_id`,`plat`,
- `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 != fromProject "> and `from_project` = #{fromProject} </if>
- <if test=" null != fromType "> and `from_type` = #{fromType} </if>
- <if test=" null != fromId "> and `from_id` = #{fromId} </if>
- <if test=" null != fromUserId "> and `from_user_id` = #{fromUserId} </if>
- <if test=" null != plat "> and `plat` = #{plat} </if>
-
- <if test=" null != startDate ">
- and `create_date` >= #{startDate}
- </if>
- <if test=" null != endDate">
- and `create_date` <= #{endDate}
- </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.UserBasicFrom" resultMap="BaseResultMap">
- select <include refid="allColumns" />
- from user_basic_from
- <include refid="dynamicWhereConditions" />
- </select>
-
- </mapper>
|