后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 line
2.3 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.UserBasicFromMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.UserBasicFrom">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="from_project" jdbcType="INTEGER" property="fromProject" />
  9. <result column="from_type" jdbcType="INTEGER" property="fromType" />
  10. <result column="from_id" jdbcType="BIGINT" property="fromId" />
  11. <result column="from_user_id" jdbcType="BIGINT" property="fromUserId" />
  12. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`tenant_id`,`parent_tenant_id`,
  16. `from_project`,`from_type`,`from_id`,`from_user_id`,`plat`,
  17. `create_date`
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where 1 = 1
  21. <if test=" null != id "> and `id` = #{id} </if>
  22. <if test=" null != tenantId and '' != tenantId">
  23. and `tenant_id` = #{tenantId}
  24. </if>
  25. <if test=" null != parentTenantId and '' != parentTenantId">
  26. and `parent_tenant_id` = #{parentTenantId}
  27. </if>
  28. <if test=" null != fromProject "> and `from_project` = #{fromProject} </if>
  29. <if test=" null != fromType "> and `from_type` = #{fromType} </if>
  30. <if test=" null != fromId "> and `from_id` = #{fromId} </if>
  31. <if test=" null != fromUserId "> and `from_user_id` = #{fromUserId} </if>
  32. <if test=" null != plat "> and `plat` = #{plat} </if>
  33. <if test=" null != startDate ">
  34. and `create_date` &gt;= #{startDate}
  35. </if>
  36. <if test=" null != endDate">
  37. and `create_date` &lt;= #{endDate}
  38. </if>
  39. <if test=" null != ids ">
  40. and id in
  41. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  42. #{idItem}
  43. </foreach>
  44. </if>
  45. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  46. </sql>
  47. <select id="findList" parameterType="com.iformall.domain.po.UserBasicFrom" resultMap="BaseResultMap">
  48. select <include refid="allColumns" />
  49. from user_basic_from
  50. <include refid="dynamicWhereConditions" />
  51. </select>
  52. </mapper>