AuditItemsDoMapper.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.AuditItemsDoMapper">
  6. <resultMap type="AuditItemsDo" id="AuditItemsResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fPid" column="f_pid" />
  9. <result property="actId" column="act_id" />
  10. <result property="billId" column="bill_id" />
  11. <result property="fBsno" column="f_bsno" />
  12. </resultMap>
  13. <insert id="insert" parameterType="AuditItemsDo" useGeneratedKeys="true" keyProperty="fId">
  14. insert into audit_items_do
  15. <trim prefix="(" suffix=")" suffixOverrides=",">
  16. <if test="fPid != null and fPid != ''">f_pid,</if>
  17. <if test="actId != null and actId != ''">act_id,</if>
  18. <if test="billId != null and billId != ''">bill_id,</if>
  19. <if test="fBsno != null">f_bsno,</if>
  20. </trim>
  21. <trim prefix="values (" suffix=")" suffixOverrides=",">
  22. <if test="fPid != null and fPid != ''">#{fPid},</if>
  23. <if test="actId != null and actId != ''">#{actId},</if>
  24. <if test="billId != null and billId != ''">#{billId},</if>
  25. <if test="fBsno != null">#{fBsno},</if>
  26. </trim>
  27. </insert>
  28. <update id="updateById" parameterType="com.ruoyi.approvalFlow.domain.AuditItemsDo">
  29. UPDATE
  30. audit_items_do
  31. <trim prefix="SET" suffixOverrides=",">
  32. <if test="fPid != null and fPid != ''">f_pid = #{fPid},</if>
  33. <if test="actId != null and actId != ''">act_id = #{actId},</if>
  34. <if test="billId != null and billId != ''">bill_id = #{billId},</if>
  35. <if test="fBsno != null">f_bsno = #{fBsno},</if>
  36. </trim>
  37. WHERE
  38. f_id = #{fId}
  39. </update>
  40. <delete id="deleteById" parameterType="com.ruoyi.approvalFlow.domain.AuditItemsDo">
  41. delete from audit_items_do where f_id = #{id}
  42. </delete>
  43. <delete id="deleteByFPid" parameterType="com.ruoyi.approvalFlow.domain.AuditItemsDo">
  44. delete from audit_items_do where f_pid = #{fPid}
  45. </delete>
  46. <select id="selectById" parameterType="AuditItemsDo" resultMap="AuditItemsResult">
  47. SELECT
  48. f_id,
  49. f_pid,
  50. act_id,
  51. bill_id,
  52. f_bsno
  53. FROM
  54. audit_items_do
  55. WHERE f_id = #{fId}
  56. </select>
  57. <select id="selectByFPid" parameterType="com.ruoyi.approvalFlow.domain.AuditItemsDo" resultType="Map">
  58. SELECT
  59. f_id as fId,
  60. f_pid as fPid,
  61. act_id as actId,
  62. bill_id as billId,
  63. f_bsno as fBsno
  64. FROM
  65. audit_items_do
  66. WHERE f_pid = #{fPid}
  67. </select>
  68. <select id="selectByActIdAndBillId" parameterType="com.ruoyi.approvalFlow.domain.AuditItemsDo" resultType="Map">
  69. SELECT
  70. f_id as fId,
  71. f_pid as fPid,
  72. act_id as actId,
  73. bill_id as billId,
  74. f_bsno as fBsno
  75. FROM
  76. audit_items_do
  77. WHERE act_id = #{actId} AND bill_id = #{billId}
  78. </select>
  79. </mapper>