DemandLogMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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.goafanti.common.dao.DemandLogMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandLog" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="demand_id" property="demandId" jdbcType="VARCHAR" />
  7. <result column="status" property="status" jdbcType="INTEGER" />
  8. <result column="operator" property="operator" jdbcType="VARCHAR" />
  9. <result column="principal" property="principal" jdbcType="VARCHAR" />
  10. <result column="recored_time" property="recoredTime" jdbcType="TIMESTAMP" />
  11. <result column="comment" property="comment" jdbcType="VARCHAR" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. id, demand_id, status, operator, principal, recored_time, comment
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from demand_log
  20. where id = #{id,jdbcType=VARCHAR}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  23. delete from demand_log
  24. where id = #{id,jdbcType=VARCHAR}
  25. </delete>
  26. <insert id="insert" parameterType="com.goafanti.common.model.DemandLog" >
  27. insert into demand_log (id, demand_id, status,
  28. operator, principal, recored_time,
  29. comment)
  30. values (#{id,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  31. #{operator,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{recoredTime,jdbcType=TIMESTAMP},
  32. #{comment,jdbcType=VARCHAR})
  33. </insert>
  34. <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandLog" >
  35. insert into demand_log
  36. <trim prefix="(" suffix=")" suffixOverrides="," >
  37. <if test="id != null" >
  38. id,
  39. </if>
  40. <if test="demandId != null" >
  41. demand_id,
  42. </if>
  43. <if test="status != null" >
  44. status,
  45. </if>
  46. <if test="operator != null" >
  47. operator,
  48. </if>
  49. <if test="principal != null" >
  50. principal,
  51. </if>
  52. <if test="recoredTime != null" >
  53. recored_time,
  54. </if>
  55. <if test="comment != null" >
  56. comment,
  57. </if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides="," >
  60. <if test="id != null" >
  61. #{id,jdbcType=VARCHAR},
  62. </if>
  63. <if test="demandId != null" >
  64. #{demandId,jdbcType=VARCHAR},
  65. </if>
  66. <if test="status != null" >
  67. #{status,jdbcType=INTEGER},
  68. </if>
  69. <if test="operator != null" >
  70. #{operator,jdbcType=VARCHAR},
  71. </if>
  72. <if test="principal != null" >
  73. #{principal,jdbcType=VARCHAR},
  74. </if>
  75. <if test="recoredTime != null" >
  76. #{recoredTime,jdbcType=TIMESTAMP},
  77. </if>
  78. <if test="comment != null" >
  79. #{comment,jdbcType=VARCHAR},
  80. </if>
  81. </trim>
  82. </insert>
  83. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandLog" >
  84. update demand_log
  85. <set >
  86. <if test="demandId != null" >
  87. demand_id = #{demandId,jdbcType=VARCHAR},
  88. </if>
  89. <if test="status != null" >
  90. status = #{status,jdbcType=INTEGER},
  91. </if>
  92. <if test="operator != null" >
  93. operator = #{operator,jdbcType=VARCHAR},
  94. </if>
  95. <if test="principal != null" >
  96. principal = #{principal,jdbcType=VARCHAR},
  97. </if>
  98. <if test="recoredTime != null" >
  99. recored_time = #{recoredTime,jdbcType=TIMESTAMP},
  100. </if>
  101. <if test="comment != null" >
  102. comment = #{comment,jdbcType=VARCHAR},
  103. </if>
  104. </set>
  105. where id = #{id,jdbcType=VARCHAR}
  106. </update>
  107. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandLog" >
  108. update demand_log
  109. set demand_id = #{demandId,jdbcType=VARCHAR},
  110. status = #{status,jdbcType=INTEGER},
  111. operator = #{operator,jdbcType=VARCHAR},
  112. principal = #{principal,jdbcType=VARCHAR},
  113. recored_time = #{recoredTime,jdbcType=TIMESTAMP},
  114. comment = #{comment,jdbcType=VARCHAR}
  115. where id = #{id,jdbcType=VARCHAR}
  116. </update>
  117. </mapper>