ReportCustomComponentRelV1ServiceDaoImplMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="reportCustomComponentRelV1ServiceDaoImpl">
  6. <!-- 保存报表组件关系信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReportCustomComponentRelInfo" parameterType="Map">
  8. insert into report_custom_component_rel(
  9. rel_id,component_id,custom_id,seq
  10. ) values (
  11. #{relId},#{componentId},#{customId},#{seq}
  12. )
  13. </insert>
  14. <!-- 查询报表组件关系信息 add by wuxw 2018-07-03 -->
  15. <select id="getReportCustomComponentRelInfo" parameterType="Map" resultType="Map">
  16. select t.rel_id,t.rel_id relId,t.component_id,t.component_id componentId,t.status_cd,t.status_cd
  17. statusCd,t.custom_id,t.custom_id customId,t.seq,cc.`name` componentName,t.create_time createTime,
  18. cc.component_type componentType,cc.component_group
  19. componentGroup,cc.query_model queryModel
  20. from report_custom_component_rel t
  21. left join report_custom_component cc on t.component_id = cc.component_id and cc.status_cd = '0'
  22. where 1 =1
  23. <if test="relId !=null and relId != ''">
  24. and t.rel_id= #{relId}
  25. </if>
  26. <if test="componentType !=null and componentType != ''">
  27. and cc.component_type= #{componentType}
  28. </if>
  29. <if test="componentId !=null and componentId != ''">
  30. and t.component_id= #{componentId}
  31. </if>
  32. <if test="statusCd !=null and statusCd != ''">
  33. and t.status_cd= #{statusCd}
  34. </if>
  35. <if test="customId !=null and customId != ''">
  36. and t.custom_id= #{customId}
  37. </if>
  38. <if test="seq !=null and seq != ''">
  39. and t.seq= #{seq}
  40. </if>
  41. order by t.create_time desc
  42. <if test="page != -1 and page != null ">
  43. limit #{page}, #{row}
  44. </if>
  45. </select>
  46. <!-- 修改报表组件关系信息 add by wuxw 2018-07-03 -->
  47. <update id="updateReportCustomComponentRelInfo" parameterType="Map">
  48. update report_custom_component_rel t set t.status_cd = #{statusCd}
  49. <if test="newBId != null and newBId != ''">
  50. ,t.b_id = #{newBId}
  51. </if>
  52. <if test="componentId !=null and componentId != ''">
  53. , t.component_id= #{componentId}
  54. </if>
  55. <if test="customId !=null and customId != ''">
  56. , t.custom_id= #{customId}
  57. </if>
  58. <if test="seq !=null and seq != ''">
  59. , t.seq= #{seq}
  60. </if>
  61. where 1=1
  62. <if test="relId !=null and relId != ''">
  63. and t.rel_id= #{relId}
  64. </if>
  65. </update>
  66. <!-- 查询报表组件关系数量 add by wuxw 2018-07-03 -->
  67. <select id="queryReportCustomComponentRelsCount" parameterType="Map" resultType="Map">
  68. select count(1) count
  69. from report_custom_component_rel t
  70. left join report_custom_component cc on t.component_id = cc.component_id and cc.status_cd = '0'
  71. where 1 =1
  72. <if test="relId !=null and relId != ''">
  73. and t.rel_id= #{relId}
  74. </if>
  75. <if test="componentType !=null and componentType != ''">
  76. and cc.component_type= #{componentType}
  77. </if>
  78. <if test="componentId !=null and componentId != ''">
  79. and t.component_id= #{componentId}
  80. </if>
  81. <if test="statusCd !=null and statusCd != ''">
  82. and t.status_cd= #{statusCd}
  83. </if>
  84. <if test="customId !=null and customId != ''">
  85. and t.custom_id= #{customId}
  86. </if>
  87. <if test="seq !=null and seq != ''">
  88. and t.seq= #{seq}
  89. </if>
  90. </select>
  91. </mapper>