SysDeptSubMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.qunzhixinxi.hnqz.admin.mapper.SysDeptSubMapper">
  4. <resultMap id="sysDeptSubMap" type="com.qunzhixinxi.hnqz.admin.entity.SysDeptSub">
  5. <id property="deptId" column="dept_id"/>
  6. <result property="appId" column="app_id"/>
  7. <result property="appSecret" column="app_secret"/>
  8. <result property="rsaPublicKey" column="rsa_public_key"/>
  9. <result property="queryUrl" column="query_url"/>
  10. <result property="subjectName" column="subject_name"/>
  11. <result property="subjectType" column="subject_type"/>
  12. <result property="limitAmount" column="limit_amount"/>
  13. <result property="enableFlag" column="enable_flag"/>
  14. </resultMap>
  15. <resultMap id="serviceChargeMap" type="com.qunzhixinxi.hnqz.admin.api.vo.SysEnterpriseServiceChargeVO">
  16. <id property="entId" column="ent_id"/>
  17. <result property="subjectLocation" column="app_id"/>
  18. <result property="serviceCharge" column="app_secret"/>
  19. </resultMap>
  20. <select id="getSettleAmountMonitor" resultType="com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput">
  21. SELECT
  22. t.id_card_number,
  23. sum(t.settle_amount) AS totalAmount
  24. FROM wm_score_package_settle_note t
  25. WHERE t.subject_location = #{query.location, jdbcType=VARCHAR}
  26. AND t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
  27. AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
  28. AND t.id_card_number IN
  29. <foreach item="item" index="index" collection="query.idCards" open="(" separator="," close=")">
  30. #{item}
  31. </foreach>
  32. <if test="query.settleNoteIds != null and query.settleNoteIds.size()>0">
  33. AND t.id NOT IN
  34. <foreach item="item" index="index" collection="query.settleNoteIds" open="(" separator="," close=")">
  35. #{item}
  36. </foreach>
  37. </if>
  38. GROUP BY t.id_card_number
  39. </select>
  40. <select id="getDeptAmountMonitor" resultType="com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput">
  41. SELECT
  42. t.user_id,
  43. sum(t.settle_amount) AS totalAmount
  44. FROM wm_score_package_settle_note t
  45. WHERE t.subject_location = #{query.location, jdbcType=VARCHAR}
  46. AND t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
  47. AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
  48. AND t.user_id IN
  49. <foreach item="item" index="index" collection="query.userIds" open="(" separator="," close=")">
  50. #{item}
  51. </foreach>
  52. <if test="query.settleNoteIds != null and query.settleNoteIds.size()>0">
  53. AND t.id NOT IN
  54. <foreach item="item" index="index" collection="query.settleNoteIds" open="(" separator="," close=")">
  55. #{item}
  56. </foreach>
  57. </if>
  58. GROUP BY t.user_id
  59. </select>
  60. <select id="getYaoyiAmountMonitor" resultType="com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput">
  61. SELECT
  62. t.id_card_number,
  63. sum(t.settle_amount) AS totalAmount
  64. FROM wm_score_package_settle_note t
  65. WHERE t.create_time &gt; #{query.startTime,jdbcType=TIMESTAMP}
  66. AND t.create_time &lt; #{query.endTime,jdbcType=TIMESTAMP}
  67. AND t.id_card_number IN
  68. <foreach item="item" index="index" collection="query.idCards" open="(" separator="," close=")">
  69. #{item}
  70. </foreach>
  71. <if test="query.settleNoteIds != null and query.settleNoteIds.size()>0">
  72. AND t.id NOT IN
  73. <foreach item="item" index="index" collection="query.settleNoteIds" open="(" separator="," close=")">
  74. #{item}
  75. </foreach>
  76. </if>
  77. GROUP BY t.id_card_number
  78. </select>
  79. <select id="listSysEnterpriseServiceCharge" resultMap="serviceChargeMap">
  80. SELECT ds.dept_id AS `ent_id`,
  81. ds.subject_location ,
  82. ds.service_charge
  83. FROM sys_dept_sub ds
  84. WHERE ds.dept_id = #{deptId}
  85. </select>
  86. </mapper>