BigScreamDao.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.hwrj.cloud.admin.dao.BigScreamDao">
  4. <select id="data1" resultType="java.util.Map">
  5. SELECT
  6. a.*,
  7. ( SELECT count( 0 ) FROM ums_company_info WHERE comp_status = 0 ) AS companyNum,
  8. (select count(0) from ums_member_origin where state = 0) as originNum,
  9. (select count(0) from pms_product where delete_status = 0) as productNum
  10. FROM
  11. ums_platform a
  12. WHERE
  13. a.id = #{id}
  14. </select>
  15. <select id="data2" resultType="java.util.Map" parameterType="java.lang.String">
  16. SELECT
  17. a.comp_name AS compName,
  18. a.company_type AS companyType,
  19. a.longitude AS lng,
  20. a.latitude AS lat,
  21. a.comp_manage_product as compProduct
  22. FROM
  23. `ums_company_info` a
  24. WHERE
  25. 1=1
  26. <if test="compType != null and compType != ''">
  27. and a.company_type=#{compType}
  28. </if>
  29. </select>
  30. <resultMap id="productMap" type="java.util.Map">
  31. <collection property="productList" javaType="java.util.List" select="com.hwrj.cloud.admin.dao.BigScreamDao.data5"
  32. column="{productName=name}" ofType="java.util.Map">
  33. </collection>
  34. </resultMap>
  35. <!-- 获取产品分布信息 lym -->
  36. <select id="data4" resultMap="productMap">
  37. SELECT id,parent_id AS parentId,`name`,product_unit AS productUnit FROM pms_product_category
  38. WHERE parent_id = 0 AND show_status = 1
  39. ORDER BY sort ASC
  40. </select>
  41. <!-- 获取产品种植面积分布信息 lym -->
  42. <select id="data5" resultType="map">
  43. SELECT a.latitude AS lat,a.longitude AS lng,b.plant_area AS value FROM ums_member_origin a
  44. INNER JOIN ums_member_origin_product b ON a.id = b.fk_origin_id
  45. WHERE a.state = 0 AND b.state = 0
  46. AND b.product_name = #{productName}
  47. </select>
  48. <select id="data6" resultType="java.lang.String">
  49. SELECT CONCAT(IFNULL(a.comp_name,' '),'---',a.`name`,'---',IFNULL(a.spec,' '),'---',a.price) as pri FROM `pms_product` a where delete_status=0
  50. </select>
  51. <select id="data7" resultType="java.lang.String">
  52. SELECT CONCAT(CASE um.cert
  53. WHEN 1 THEN
  54. IFNULL(um.type,um.nickname)
  55. WHEN 2 THEN
  56. IFNULL(um.company_info,um.nickname)
  57. ELSE
  58. um.nickname
  59. END
  60. ,'---',op.product_name) FROM `oms_pre_item` op LEFT JOIN ums_member um on op.member_id= um.id where op.delete_status=0 and um.`status`=1
  61. </select>
  62. <select id="data8" resultType="java.lang.String">
  63. SELECT
  64. CONCAT(
  65. company_type,
  66. '---',
  67. company_type,
  68. '---',
  69. COUNT(0)
  70. ) comp
  71. FROM
  72. ums_company_info
  73. WHERE
  74. comp_status = 0
  75. GROUP BY
  76. company_type </select>
  77. <select id="data9" resultType="java.lang.String">
  78. SELECT
  79. concat(id, '---', comp_name)
  80. FROM
  81. ums_company_info
  82. WHERE
  83. comp_status = 0
  84. </select>
  85. </mapper>