FirmInfoMapper.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.zsElectric.boot.business.mapper.FirmInfoMapper">
  4. <!-- 获取企业信息分页列表 -->
  5. <select id="getFirmInfoPage" resultType="com.zsElectric.boot.business.model.vo.FirmInfoVO">
  6. SELECT
  7. a.id,
  8. a.dept_id,
  9. a.NAME,
  10. a.number,
  11. COUNT( b.id ) AS empNum,
  12. a.STATUS,
  13. IFNULL(a.balance, 0.00) AS balance,
  14. IFNULL(a.total_recharge, 0.00) AS totalRecharge,
  15. IFNULL(a.current_profit, 0.00) AS currentProfit,
  16. IFNULL(a.total_profit, 0.00) AS totalProfit,
  17. a.create_time,
  18. a.create_by,
  19. a.update_time,
  20. a.update_by,
  21. a.is_deleted
  22. FROM
  23. c_firm_info a
  24. LEFT JOIN c_user_firm b ON a.id = b.firm_id AND b.is_deleted = 0
  25. <where>
  26. a.is_deleted = 0
  27. <if test="queryParams.name != null">
  28. AND a.name LIKE CONCAT('%', #{queryParams.name}, '%')
  29. </if>
  30. <if test="queryParams.status != null">
  31. AND a.status = #{queryParams.status}
  32. </if>
  33. </where>
  34. GROUP BY
  35. a.id
  36. ORDER BY a.create_time DESC
  37. </select>
  38. </mapper>