后台服务
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.

InvestCustomerMapper.xml 2.2 KiB

2 年之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.InvestCustomerMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.iformall.domain.po.invest.InvestCustomerEntity" id="investCustomerMap">
  6. <result property="id" column="id"/>
  7. <result property="tenantId" column="tenant_id"/>
  8. <result property="customerNo" column="customer_no"/>
  9. <result property="name" column="name"/>
  10. <result property="phone" column="phone"/>
  11. <result property="businessId" column="business_id"/>
  12. <result property="brandId" column="brand_id"/>
  13. <result property="type" column="type"/>
  14. <result property="rating" column="rating"/>
  15. <result property="investChannel" column="invest_channel"/>
  16. <result property="contractNo" column="contract_no"/>
  17. <result property="createDate" column="create_date"/>
  18. <result property="updateDate" column="update_date"/>
  19. </resultMap>
  20. <select id="listByIds" resultType="com.iformall.domain.vo.invest.InvestCustomerVo">
  21. SELECT c.*,d.`id` AS demandId,d.`owner` AS demandOwner FROM `invest_follow_record` f
  22. INNER JOIN `invest_customer` c ON c.id=f.`follow_id`
  23. INNER JOIN `invest_demand` d ON d.`customer_id`=c.id
  24. where 1=1
  25. <if test=" null != type and type.size()>0">
  26. AND c.type in
  27. <foreach collection="type" index="index" item="idItem" open="(" separator="," close=")">
  28. #{idItem}
  29. </foreach>
  30. </if>
  31. <if test=" null != ids and ids.size()>0">
  32. AND c.id in
  33. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  34. #{idItem}
  35. </foreach>
  36. </if>
  37. </select>
  38. <select id="countCustomerUnassigned" resultType="int">
  39. SELECT count(1)
  40. FROM `invest_customer` c
  41. INNER JOIN `invest_demand` d ON d.`customer_id` = c.id
  42. WHERE d.`owner` = 0 AND c.type in (0,1,3)
  43. AND c.`tenant_id` = #{tenantId};
  44. </select>
  45. </mapper>