PtApprovalMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.ruoyi.interfaces.mapper.PtApprovalDao">
  4. <resultMap type="com.ruoyi.interfaces.domain.PtApproval" id="ptApprovalResultMap">
  5. <result property="id" column="ID" jdbcType="VARCHAR"/>
  6. <result property="applyUnit" column="APPLY_UNIT" jdbcType="VARCHAR"/>
  7. <result property="srvName" column="SRV_NAME" jdbcType="VARCHAR"/>
  8. <result property="srvId" column="SRV_ID" jdbcType="VARCHAR"/>
  9. <result property="status" column="STATUS" jdbcType="VARCHAR"/>
  10. <result property="opinion" column="OPINION" jdbcType="VARCHAR"/>
  11. <result property="approvalerId" column="APPROVALER_ID" jdbcType="VARCHAR"/>
  12. <result property="approvalerName" column="APPROVALER_NAME" jdbcType="VARCHAR"/>
  13. <result property="tm" column="TM" jdbcType="VARCHAR"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID
  17. ,
  18. APPLY_UNIT,
  19. SRV_NAME,
  20. SRV_ID,
  21. STATUS,
  22. OPINION,
  23. APPROVALER_ID,
  24. APPROVALER_NAME,
  25. TM
  26. </sql>
  27. <sql id="entity_properties">
  28. #{id,jdbcType=VARCHAR}
  29. ,
  30. #{applyUnit,jdbcType=VARCHAR},
  31. #{srvName,jdbcType=VARCHAR},
  32. #{srvId,jdbcType=VARCHAR},
  33. #{status,jdbcType=VARCHAR},
  34. #{opinion,jdbcType=VARCHAR},
  35. #{approvalerId,jdbcType=VARCHAR},
  36. #{approvalerName,jdbcType=VARCHAR},
  37. #{tm,jdbcType=VARCHAR}
  38. </sql>
  39. <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtApproval">
  40. insert into PT_APPROVAL(
  41. <include refid="table_columns"/>
  42. )
  43. values (
  44. <include refid="entity_properties"/>
  45. )
  46. </insert>
  47. <select id="selectByPrimaryKey" resultMap="ptApprovalResultMap" parameterType="java.lang.String">
  48. select
  49. <include refid="table_columns"/>
  50. from PT_APPROVAL
  51. where 1=1
  52. <if test="_parameter != null and _parameter !=''">
  53. and ID = #{_parameter,jdbcType=VARCHAR}
  54. </if>
  55. </select>
  56. <select id="selectBySrvId" resultMap="ptApprovalResultMap" parameterType="java.lang.String">
  57. select
  58. <include refid="table_columns"/>
  59. from PT_APPROVAL
  60. where SRV_ID = #{srvId,jdbcType=VARCHAR}
  61. </select>
  62. <update id="updateByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtApproval">
  63. update PT_APPROVAL
  64. <set>
  65. <if test="applyUnit != null and applyUnit !=''">
  66. APPLY_UNIT = #{applyUnit,jdbcType=VARCHAR},
  67. </if>
  68. <if test="srvName != null and srvName !=''">
  69. SRV_NAME = #{srvName,jdbcType=VARCHAR},
  70. </if>
  71. <if test="srvId != null and srvId !=''">
  72. SRV_ID = #{srvId,jdbcType=VARCHAR},
  73. </if>
  74. <if test="status != null and status !=''">
  75. STATUS = #{status,jdbcType=VARCHAR},
  76. </if>
  77. <if test="opinion != null and opinion !=''">
  78. OPINION = #{opinion,jdbcType=VARCHAR},
  79. </if>
  80. <if test="approvalerId != null and approvalerId !=''">
  81. APPROVALER_ID = #{approvalerId,jdbcType=VARCHAR},
  82. </if>
  83. <if test="approvalerName != null and approvalerName !=''">
  84. APPROVALER_NAME = #{approvalerName,jdbcType=VARCHAR},
  85. </if>
  86. <if test="tm != null and tm !=''">
  87. TM = #{tm,jdbcType=VARCHAR},
  88. </if>
  89. </set>
  90. where ID = #{id,jdbcType=VARCHAR}
  91. </update>
  92. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  93. delete
  94. from PT_APPROVAL
  95. where ID = #{id,jdbcType=VARCHAR}
  96. </delete>
  97. </mapper>