后台服务
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

82 řádky
3.0 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.MallCooUserInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallCooUserInfo">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="open_user_id" jdbcType="VARCHAR" property="openUserId"/>
  7. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  8. <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
  9. <result column="gender" jdbcType="INTEGER" property="gender"/>
  10. <result column="address" jdbcType="VARCHAR" property="address"/>
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  13. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  14. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  15. <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
  16. <result column="user_name" jdbcType="VARCHAR" property="userName"/>
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`open_user_id`,`phone`,`birthdate`,`gender`,
  20. `address`,`create_date`,`update_date`,
  21. `final_tenant_id`,`tenant_id`,`parent_tenant_id`,`user_name`
  22. </sql>
  23. <sql id="dynamicWhereConditions">
  24. where `final_tenant_id` = #{finalTenantId}
  25. <if test=" null != id ">
  26. and `id` = #{id}
  27. </if>
  28. <if test=" null != phone ">
  29. and `phone` like concat('%', #{phone},'%')
  30. </if>
  31. <if test=" null != birthdate ">
  32. and `birthdate` = #{birthdate}
  33. </if>
  34. <if test=" null != gender ">
  35. and `gender` = #{gender}
  36. </if>
  37. <if test=" null != address ">
  38. and `address` like concat('%', #{address},'%')
  39. </if>
  40. <if test=" null != userName ">
  41. and `user_name` like concat('%', #{userName},'%')
  42. </if>
  43. <if test=" null != startTime and null != endTime">
  44. and `create_date` between #{startTime} and #{endTime}
  45. </if>
  46. <if test=" null != ids ">
  47. and id in
  48. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  49. #{idItem}
  50. </foreach>
  51. </if>
  52. <if test=" null != sortColumns">order by ${sortColumns}</if>
  53. </sql>
  54. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  55. select <include refid="allColumns"/>
  56. from mall_coo_user_info
  57. where id =#{id}
  58. and final_tenant_id = #{finalTenantId}
  59. </select>
  60. <select id="findList" parameterType="com.iformall.domain.po.MallCooUserInfo" resultMap="BaseResultMap">
  61. select
  62. <include refid="allColumns"/>
  63. from mall_coo_user_info
  64. <include refid="dynamicWhereConditions"/>
  65. </select>
  66. </mapper>