ContactManagementDao.xml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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="platform.modules.company.dao.ContactManagementDao">
  4. <!-- 分页查询列表 -->
  5. <select id="findPage" resultType="platform.modules.company.entity.ContactManagement">
  6. <!-- SELECT *
  7. FROM
  8. z_contact_management cm
  9. LEFT JOIN sys_department dep ON cm.did = dep.id
  10. Left join s_street str on str.id = cm.did
  11. WHERE
  12. cm.del_flag = 0
  13. AND
  14. dep.del_flag = 0
  15. <if test="keyWord != null and keyWord != ''">
  16. AND
  17. (
  18. (cm.name LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  19. OR(cm.phone LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  20. )
  21. </if>
  22. ORDER BY cm.create_name DESC -->
  23. SELECT *
  24. FROM
  25. z_contact_management cm
  26. Left join s_street str on cm.did - #{maxId} = str.id
  27. LEFT JOIN sys_department dept ON dept.id = cm.did
  28. WHERE
  29. cm.del_flag = 0
  30. <if test="keyWord != null and keyWord != ''">
  31. AND
  32. (
  33. (cm.contact_name LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  34. OR(cm.phone LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  35. OR(dept.name LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  36. OR(str.name LIKE CONCAT(CONCAT('%',#{keyWord}),'%'))
  37. )
  38. </if>
  39. AND
  40. ( str.del_flag = 0
  41. OR
  42. dept.del_flag = 0
  43. )
  44. AND str.is_start = 1
  45. ORDER BY cm.create_time DESC
  46. </select>
  47. </mapper>