OrderPublicReleaseLogMapper.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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.OrderPublicReleaseLogMapper">
  4. <resultMap type="com.goafanti.common.model.OrderPublicReleaseLog" id="OrderPublicReleaseLogMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
  7. <result property="processStatus" column="process_status" jdbcType="INTEGER"/>
  8. <result property="status" column="status" jdbcType="INTEGER"/>
  9. <result property="useDuration" column="use_duration" jdbcType="NUMERIC"/>
  10. <result property="newDuration" column="new_duration" jdbcType="NUMERIC"/>
  11. <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
  12. <result property="auditor" column="auditor" jdbcType="VARCHAR"/>
  13. <result property="auditorName" column="auditor_name" jdbcType="VARCHAR"/>
  14. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  15. </resultMap>
  16. <sql id="OrderPublicReleaseLogAllSql">
  17. id, order_no, process_status, status, use_duration, new_duration, remarks, auditor, auditor_name, create_time
  18. </sql>
  19. <!--查询单个-->
  20. <select id="queryById" resultMap="OrderPublicReleaseLogMap">
  21. select
  22. <include refid="OrderPublicReleaseLogAllSql"/>
  23. from order_public_release_log
  24. where id = #{id}
  25. </select>
  26. <!--查询指定行数据-->
  27. <select id="findOrderPublicReleaseLogList" resultMap="OrderPublicReleaseLogMap">
  28. select
  29. <include refid="OrderPublicReleaseLogAllSql"/>
  30. from order_public_release_log
  31. <where>
  32. <if test="id != null">
  33. and id = #{id}
  34. </if>
  35. <if test="orderNo != null and orderNo != ''">
  36. and order_no = #{orderNo}
  37. </if>
  38. <if test="processStatus != null">
  39. and process_status = #{processStatus}
  40. </if>
  41. <if test="status != null">
  42. and status = #{status}
  43. </if>
  44. <if test="useDuration != null">
  45. and use_duration = #{useDuration}
  46. </if>
  47. <if test="newDuration != null">
  48. and new_duration = #{newDuration}
  49. </if>
  50. <if test="remarks != null and remarks != ''">
  51. and remarks = #{remarks}
  52. </if>
  53. <if test="auditor != null and auditor != ''">
  54. and auditor = #{auditor}
  55. </if>
  56. <if test="auditorName != null and auditorName != ''">
  57. and auditor_name = #{auditorName}
  58. </if>
  59. <if test="createTime != null">
  60. and create_time = #{createTime}
  61. </if>
  62. </where>
  63. <if test="page_sql != null">
  64. ${page_sql}
  65. </if>
  66. </select>
  67. <!--统计总行数-->
  68. <select id="findOrderPublicReleaseLogCount" resultType="java.lang.Integer">
  69. select count(1)
  70. from order_public_release_log
  71. <where>
  72. <if test="id != null">
  73. and id = #{id}
  74. </if>
  75. <if test="orderNo != null and orderNo != ''">
  76. and order_no = #{orderNo}
  77. </if>
  78. <if test="processStatus != null">
  79. and process_status = #{processStatus}
  80. </if>
  81. <if test="status != null">
  82. and status = #{status}
  83. </if>
  84. <if test="useDuration != null">
  85. and use_duration = #{useDuration}
  86. </if>
  87. <if test="newDuration != null">
  88. and new_duration = #{newDuration}
  89. </if>
  90. <if test="remarks != null and remarks != ''">
  91. and remarks = #{remarks}
  92. </if>
  93. <if test="auditor != null and auditor != ''">
  94. and auditor = #{auditor}
  95. </if>
  96. <if test="auditorName != null and auditorName != ''">
  97. and auditor_name = #{auditorName}
  98. </if>
  99. <if test="createTime != null">
  100. and create_time = #{createTime}
  101. </if>
  102. </where>
  103. </select>
  104. <!--新增所有列-->
  105. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  106. insert into order_public_release_log(order_no, process_status, status, use_duration, new_duration, remarks,
  107. auditor, auditor_name, create_time)
  108. values (#{orderNo}, #{processStatus}, #{status}, #{useDuration}, #{newDuration}, #{remarks}, #{auditor},
  109. #{auditorName}, #{createTime})
  110. </insert>
  111. <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
  112. insert into order_public_release_log(order_no, process_status, status, use_duration, new_duration, remarks,
  113. auditor, auditor_name, create_time)
  114. values
  115. <foreach collection="entities" item="entity" separator=",">
  116. (#{entity.orderNo}, #{entity.processStatus}, #{entity.status}, #{entity.useDuration}, #{entity.newDuration},
  117. #{entity.remarks}, #{entity.auditor}, #{entity.auditorName}, #{entity.createTime})
  118. </foreach>
  119. </insert>
  120. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  121. insert into order_public_release_log(order_no, process_status, status, use_duration, new_duration, remarks,
  122. auditor, auditor_name, create_time)
  123. values
  124. <foreach collection="entities" item="entity" separator=",">
  125. (#{entity.orderNo}, #{entity.processStatus}, #{entity.status}, #{entity.useDuration}, #{entity.newDuration},
  126. #{entity.remarks}, #{entity.auditor}, #{entity.auditorName}, #{entity.createTime})
  127. </foreach>
  128. on duplicate key update
  129. order_no = values(order_no),
  130. process_status = values(process_status),
  131. status = values(status),
  132. use_duration = values(use_duration),
  133. new_duration = values(new_duration),
  134. remarks = values(remarks),
  135. auditor = values(auditor),
  136. auditor_name = values(auditor_name),
  137. create_time = values(create_time)
  138. </insert>
  139. <!--通过主键修改数据-->
  140. <update id="update">
  141. update order_public_release_log
  142. <set>
  143. <if test="orderNo != null and orderNo != ''">
  144. order_no = #{orderNo},
  145. </if>
  146. <if test="processStatus != null">
  147. process_status = #{processStatus},
  148. </if>
  149. <if test="status != null">
  150. status = #{status},
  151. </if>
  152. <if test="useDuration != null">
  153. use_duration = #{useDuration},
  154. </if>
  155. <if test="newDuration != null">
  156. new_duration = #{newDuration},
  157. </if>
  158. <if test="remarks != null and remarks != ''">
  159. remarks = #{remarks},
  160. </if>
  161. <if test="auditor != null and auditor != ''">
  162. auditor = #{auditor},
  163. </if>
  164. <if test="auditorName != null and auditorName != ''">
  165. auditor_name = #{auditorName},
  166. </if>
  167. <if test="createTime != null">
  168. create_time = #{createTime},
  169. </if>
  170. </set>
  171. where id = #{id}
  172. </update>
  173. <!--通过主键删除-->
  174. <delete id="deleteById">
  175. delete
  176. from order_public_release_log
  177. where id = #{id}
  178. </delete>
  179. <select id="queryByOrderNo" resultMap="OrderPublicReleaseLogMap">
  180. select
  181. <include refid="OrderPublicReleaseLogAllSql"/>
  182. from order_public_release_log
  183. where order_no = #{orderNo}
  184. </select>
  185. </mapper>