TOrderPublicReleaseCountMapper.xml 7.2 KB

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