AuditPathsLevelsMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.AuditPathsLevelsMapper">
  6. <resultMap type="AuditPathsLevels" id="AuditPathsLevelsResult">
  7. <result property="id" column="id"/>
  8. <result property="pathId" column="path_id"/>
  9. <result property="levelId" column="level_id"/>
  10. <result property="levelName" column="level_name"/>
  11. <result property="auditUserId" column="audit_user_id"/>
  12. <result property="iffixAuditUser" column="iffix_audit_user"/>
  13. <result property="iffinalItem" column="iffinal_item"/>
  14. <result property="remarks" column="remarks"/>
  15. </resultMap>
  16. <sql id="selectAuditPathsLevelsVo">
  17. select id, path_id, level_id, level_name, audit_user_id, iffix_audit_user, iffinal_item, remarks from audit_paths_levels
  18. </sql>
  19. <select id="queryAuditLevels" parameterType="Long" resultMap="AuditPathsLevelsResult">
  20. SELECT
  21. lev.id,
  22. lev.level_id,
  23. lev.audit_user_id,
  24. lev.iffix_audit_user,
  25. lev.iffinal_item,
  26. lev.remarks
  27. FROM
  28. audit_paths_acts act
  29. LEFT JOIN audit_paths_levels lev ON act.path_id = lev.path_id
  30. where
  31. act.act_id = #{actId}
  32. </select>
  33. <select id="selectAuditPathsLevelsList" parameterType="AuditPathsLevels" resultMap="AuditPathsLevelsResult">
  34. <include refid="selectAuditPathsLevelsVo"/>
  35. <where>
  36. <if test="pathId != null ">and path_id = #{pathId}</if>
  37. <if test="levelId != null ">and level_id = #{levelId}</if>
  38. <if test="levelName != null and levelName != ''">and level_name like concat('%', #{levelName}, '%')</if>
  39. <if test="auditUserId != null and auditUserId != ''">and audit_user_id = #{auditUserId}</if>
  40. <if test="iffixAuditUser != null and iffixAuditUser != ''">and iffix_audit_user = #{iffixAuditUser}</if>
  41. <if test="iffinalItem != null and iffinalItem != ''">and iffinal_item = #{iffinalItem}</if>
  42. <if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
  43. </where>
  44. </select>
  45. <select id="selectAuditPathsLevelsById" parameterType="Long" resultMap="AuditPathsLevelsResult">
  46. <include refid="selectAuditPathsLevelsVo"/>
  47. where id = #{id}
  48. </select>
  49. <insert id="insertAuditPathsLevels" parameterType="AuditPathsLevels" useGeneratedKeys="true" keyProperty="id">
  50. insert into audit_paths_levels
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="pathId != null">path_id,</if>
  53. <if test="levelId != null">level_id,</if>
  54. <if test="levelName != null">level_name,</if>
  55. <if test="auditUserId != null">audit_user_id,</if>
  56. <if test="iffixAuditUser != null">iffix_audit_user,</if>
  57. <if test="iffinalItem != null">iffinal_item,</if>
  58. <if test="remarks != null">remarks,</if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="pathId != null">#{pathId},</if>
  62. <if test="levelId != null">#{levelId},</if>
  63. <if test="levelName != null">#{levelName},</if>
  64. <if test="auditUserId != null">#{auditUserId},</if>
  65. <if test="iffixAuditUser != null">#{iffixAuditUser},</if>
  66. <if test="iffinalItem != null">#{iffinalItem},</if>
  67. <if test="remarks != null">#{remarks},</if>
  68. </trim>
  69. </insert>
  70. <update id="updateAuditPathsLevels" parameterType="AuditPathsLevels">
  71. update audit_paths_levels
  72. <trim prefix="SET" suffixOverrides=",">
  73. <if test="pathId != null">path_id = #{pathId},</if>
  74. <if test="levelId != null">level_id = #{levelId},</if>
  75. <if test="levelName != null">level_name = #{levelName},</if>
  76. <if test="auditUserId != null">audit_user_id = #{auditUserId},</if>
  77. <if test="iffixAuditUser != null">iffix_audit_user = #{iffixAuditUser},</if>
  78. <if test="iffinalItem != null">iffinal_item = #{iffinalItem},</if>
  79. <if test="remarks != null">remarks = #{remarks},</if>
  80. </trim>
  81. where id = #{id}
  82. </update>
  83. <delete id="deleteAuditPathsLevelsById" parameterType="Long">
  84. delete from audit_paths_levels where id = #{id}
  85. </delete>
  86. <delete id="deleteAuditPathsLevelsBypathId" parameterType="Long">
  87. delete from audit_paths_levels where path_id = #{id}
  88. </delete>
  89. <delete id="deleteAuditPathsLevelsByIds" parameterType="String">
  90. delete from audit_paths_levels where id in
  91. <foreach item="id" collection="array" open="(" separator="," close=")">
  92. #{id}
  93. </foreach>
  94. </delete>
  95. </mapper>