AuditPathsActsMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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="com.ruoyi.approvalFlow.mapper.AuditPathsActsMapper">
  6. <resultMap type="AuditPathsActs" id="AuditPathsActsResult">
  7. <result property="id" column="id"/>
  8. <result property="branchId" column="branch_id"/>
  9. <result property="actId" column="act_id"/>
  10. <result property="reviewConditions" column="review_conditions"/>
  11. <result property="pathId" column="path_id"/>
  12. </resultMap>
  13. <sql id="selectAuditPathsActsVo">
  14. select id, branch_id, act_id, review_conditions, path_id from audit_paths_acts
  15. </sql>
  16. <select id="selectAuditPathsActsList" parameterType="AuditPathsActs" resultMap="AuditPathsActsResult">
  17. <include refid="selectAuditPathsActsVo"/>
  18. <where>
  19. <if test="branchId != null ">and branch_id = #{branchId}</if>
  20. <if test="actId != null ">and act_id = #{actId}</if>
  21. <if test="reviewConditions != null and reviewConditions != ''">and review_conditions =
  22. #{reviewConditions}
  23. </if>
  24. <if test="pathId != null ">and path_id = #{pathId}</if>
  25. </where>
  26. </select>
  27. <select id="selectAuditPathsActsCount" parameterType="AuditPathsActs" resultType="int">
  28. select
  29. COUNT(id)
  30. from
  31. audit_paths_acts
  32. <where>
  33. <if test="branchId != null ">and branch_id = #{branchId}</if>
  34. <if test="actId != null ">and act_id = #{actId}</if>
  35. <if test="reviewConditions != null and reviewConditions != ''">and review_conditions =
  36. #{reviewConditions}
  37. </if>
  38. <if test="pathId != null ">and path_id = #{pathId}</if>
  39. </where>
  40. </select>
  41. <select id="selectCountAuditPathsActs" parameterType="AuditPathsActs" resultType="int">
  42. SELECT
  43. COUNT(id)
  44. FROM
  45. audit_paths_acts
  46. <where>
  47. <if test="pathId != null ">and path_id = #{pathId}</if>
  48. <if test="actId != null ">and act_id = #{actId}</if>
  49. <if test="reviewConditions != null and reviewConditions != ''">and review_conditions =
  50. #{reviewConditions}
  51. </if>
  52. <if test="pathId != null ">and path_id = #{pathId}</if>
  53. </where>
  54. </select>
  55. <select id="selectAuditPathsActsById" parameterType="Long" resultMap="AuditPathsActsResult">
  56. <include refid="selectAuditPathsActsVo"/>
  57. where id = #{id}
  58. </select>
  59. <insert id="insertAuditPathsActs" parameterType="AuditPathsActs" useGeneratedKeys="true" keyProperty="id">
  60. insert into audit_paths_acts
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="branchId != null">branch_id,</if>
  63. <if test="actId != null">act_id,</if>
  64. <if test="reviewConditions != null">review_conditions,</if>
  65. <if test="pathId != null">path_id,</if>
  66. </trim>
  67. <trim prefix="values (" suffix=")" suffixOverrides=",">
  68. <if test="branchId != null">#{branchId},</if>
  69. <if test="actId != null">#{actId},</if>
  70. <if test="reviewConditions != null">#{reviewConditions},</if>
  71. <if test="pathId != null">#{pathId},</if>
  72. </trim>
  73. </insert>
  74. <update id="updateAuditPathsActs" parameterType="AuditPathsActs">
  75. update audit_paths_acts
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="branchId != null">branch_id = #{branchId},</if>
  78. <if test="actId != null">act_id = #{actId},</if>
  79. <if test="reviewConditions != null">review_conditions = #{reviewConditions},</if>
  80. <if test="pathId != null">path_id = #{pathId},</if>
  81. </trim>
  82. where id = #{id}
  83. </update>
  84. <delete id="deleteAuditPathsActsById" parameterType="Long">
  85. delete from audit_paths_acts where id = #{id}
  86. </delete>
  87. <delete id="deleteAuditPathsActsByIds" parameterType="String">
  88. delete
  89. act.*,
  90. leve.*
  91. from
  92. audit_paths_acts act
  93. left JOIN audit_paths_levels leve ON leve.path_id = act.id
  94. where
  95. act.id in
  96. <foreach item="id" collection="array" open="(" separator="," close=")">
  97. #{id}
  98. </foreach>
  99. </delete>
  100. </mapper>