OrgHonorDatumMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.OrgHonorDatumMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgHonorDatum" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="name" property="name" jdbcType="VARCHAR" />
  8. <result column="issuing_mechanism" property="issuingMechanism" jdbcType="VARCHAR" />
  9. <result column="issuing_time" property="issuingTime" jdbcType="TIMESTAMP" />
  10. <result column="enclosure_url" property="enclosureUrl" jdbcType="VARCHAR" />
  11. <result column="year" property="year" jdbcType="INTEGER" />
  12. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. id, uid, name, issuing_mechanism, issuing_time, enclosure_url, year, deleted_sign
  16. </sql>
  17. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  18. select
  19. <include refid="Base_Column_List" />
  20. from org_honor_datum
  21. where id = #{id,jdbcType=VARCHAR}
  22. </select>
  23. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  24. delete from org_honor_datum
  25. where id = #{id,jdbcType=VARCHAR}
  26. </delete>
  27. <insert id="insert" parameterType="com.goafanti.common.model.OrgHonorDatum" >
  28. insert into org_honor_datum (id, uid, name, issuing_mechanism,
  29. issuing_time, enclosure_url, year, deleted_sign
  30. )
  31. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{issuingMechanism, jdbcType=VARCHAR},
  32. #{issuingTime,jdbcType=TIMESTAMP}, #{enclosureUrl,jdbcType=VARCHAR}, #{year,jdbcType=INTEGER},
  33. #{deletedSign,jdbcType=INTEGER}
  34. )
  35. </insert>
  36. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgHonorDatum" >
  37. insert into org_honor_datum
  38. <trim prefix="(" suffix=")" suffixOverrides="," >
  39. <if test="id != null" >
  40. id,
  41. </if>
  42. <if test="uid != null" >
  43. uid,
  44. </if>
  45. <if test="name != null" >
  46. name,
  47. </if>
  48. <if test="issuing_mechanism != null">
  49. issuing_mechanism,
  50. </if>
  51. <if test="issuingTime != null" >
  52. issuing_time,
  53. </if>
  54. <if test="enclosureUrl != null" >
  55. enclosure_url,
  56. </if>
  57. <if test="year != null" >
  58. year,
  59. </if>
  60. <if test="deletedSign != null" >
  61. deleted_sign,
  62. </if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides="," >
  65. <if test="id != null" >
  66. #{id,jdbcType=VARCHAR},
  67. </if>
  68. <if test="uid != null" >
  69. #{uid,jdbcType=VARCHAR},
  70. </if>
  71. <if test="name != null" >
  72. #{name,jdbcType=VARCHAR},
  73. </if>
  74. <if test="issuingMechanism != null">
  75. #{issuingMechanism,jdbcType=VARCHAR},
  76. </if>
  77. <if test="issuingTime != null" >
  78. #{issuingTime,jdbcType=TIMESTAMP},
  79. </if>
  80. <if test="enclosureUrl != null" >
  81. #{enclosureUrl,jdbcType=VARCHAR},
  82. </if>
  83. <if test="year != null" >
  84. #{year,jdbcType=INTEGER},
  85. </if>
  86. <if test="deletedSign != null" >
  87. #{deletedSign,jdbcType=INTEGER},
  88. </if>
  89. </trim>
  90. </insert>
  91. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgHonorDatum" >
  92. update org_honor_datum
  93. <set >
  94. <if test="uid != null" >
  95. uid = #{uid,jdbcType=VARCHAR},
  96. </if>
  97. <if test="name != null" >
  98. name = #{name,jdbcType=VARCHAR},
  99. </if>
  100. <if test="issuingMechanism != null">
  101. issuing_mechanism = #{issuingMechanism,jdbcType=VARCHAR},
  102. </if>
  103. <if test="issuingTime != null" >
  104. issuing_time = #{issuingTime,jdbcType=TIMESTAMP},
  105. </if>
  106. <if test="enclosureUrl != null" >
  107. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  108. </if>
  109. <if test="year != null" >
  110. year = #{year,jdbcType=INTEGER},
  111. </if>
  112. <if test="deletedSign != null" >
  113. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  114. </if>
  115. </set>
  116. where id = #{id,jdbcType=VARCHAR}
  117. </update>
  118. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgHonorDatum" >
  119. update org_honor_datum
  120. set uid = #{uid,jdbcType=VARCHAR},
  121. name = #{name,jdbcType=VARCHAR},
  122. issuingMechanism = #{issuingMechanism,jdbcType=VARCHAR},
  123. issuing_time = #{issuingTime,jdbcType=TIMESTAMP},
  124. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  125. year = #{year,jdbcType=INTEGER},
  126. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  127. where id = #{id,jdbcType=VARCHAR}
  128. </update>
  129. <select id="findOrgHonorDatumListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  130. select
  131. <include refid="Base_Column_List" />
  132. from org_honor_datum
  133. where deleted_sign = 0
  134. <if test="uid != null">
  135. and uid = #{uid,jdbcType=VARCHAR}
  136. </if>
  137. order by issuing_time desc
  138. <if test="page_sql != null">
  139. ${page_sql}
  140. </if>
  141. </select>
  142. <select id="findOrgHonorDatumCount" resultType="java.lang.Integer" parameterType="String">
  143. select count(1)
  144. from org_honor_datum
  145. where deleted_sign = 0
  146. <if test="uid != null">
  147. and uid = #{uid,jdbcType=VARCHAR}
  148. </if>
  149. </select>
  150. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  151. update org_honor_datum set deleted_sign = 1
  152. where id in
  153. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  154. #{item}
  155. </foreach>
  156. </update>
  157. </mapper>