選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

91 行
3.5 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.WxContractCustomersMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxContractCustomers">
  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="principal_type" jdbcType="INTEGER" property="principalType"/>
  9. <result column="name" jdbcType="VARCHAR" property="name"/>
  10. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  11. <result column="legal_person" jdbcType="VARCHAR" property="legalPerson"/>
  12. <result column="id_number" jdbcType="VARCHAR" property="idNumber"/>
  13. <result column="sex" jdbcType="INTEGER" property="sex"/>
  14. <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
  15. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  16. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  17. <result column="status" jdbcType="INTEGER" property="status"/>
  18. </resultMap>
  19. <sql id="allColumns">
  20. `id`,`tenant_id`,`parent_tenant_id`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`,
  21. `link_person`,`create_date`,`update_date`,`status`
  22. </sql>
  23. <sql id="dynamicWhereConditions">
  24. where 1=1
  25. <if test=" null != id ">
  26. and `id` = #{id}
  27. </if>
  28. <if test=" null != tenantId and '' != tenantId">
  29. and `tenant_id` = #{tenantId}
  30. </if>
  31. <if test=" null != parentTenantId and '' != parentTenantId">
  32. and `parent_tenant_id` = #{parentTenantId}
  33. </if>
  34. <if test=" null != principalType">
  35. and `principal_type` = #{principalType}
  36. </if>
  37. <if test=" null != name and name != '' ">
  38. and `name` like concat('%', #{name},'%')
  39. </if>
  40. <if test=" null != nameEqal and nameEqal != '' ">
  41. and `name` = #{nameEqal}
  42. </if>
  43. <if test=" null != phone and phone != '' ">
  44. and `phone` like concat('%', #{phone},'%')
  45. </if>
  46. <if test=" null != phoneEqal and phoneEqal != '' ">
  47. and `phone` = #{phoneEqal}
  48. </if>
  49. <if test=" null != status">
  50. and `status` = #{status}
  51. </if>
  52. <if test=" null != ids ">
  53. and id in
  54. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  55. #{idItem}
  56. </foreach>
  57. </if>
  58. <if test=" null != sortColumns">order by ${sortColumns}</if>
  59. </sql>
  60. <select id="findList" parameterType="com.iformall.domain.po.WxContractCustomers" resultMap="BaseResultMap">
  61. select
  62. <include refid="allColumns"/>
  63. from wx_contract_customers
  64. <include refid="dynamicWhereConditions"/>
  65. </select>
  66. <select id="findIdList" parameterType="com.iformall.domain.po.WxContractCustomers" resultType="Long">
  67. select id
  68. from wx_contract_customers
  69. <include refid="dynamicWhereConditions"/>
  70. </select>
  71. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  72. select
  73. <include refid="allColumns"/>
  74. from wx_contract_customers where id = #{id} and `tenant_id` = #{tenantId}
  75. </select>
  76. </mapper>