BdglPrivateCarMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.militaryvehicleManagement.mapper.BdglPrivateCarMapper">
  6. <resultMap type="BdglPrivateCar" id="BdglPrivateCarResult">
  7. <result property="id" column="id" />
  8. <result property="vehiclecategory" column="vehiclecategory" />
  9. <result property="peopleId" column="people_id" />
  10. <result property="peopleName" column="people_name" />
  11. <result property="vehiclenumber" column="vehiclenumber" />
  12. <result property="vehiclecolor" column="vehiclecolor" />
  13. <result property="vehiclemodel" column="vehiclemodel" />
  14. <result property="contactnumber" column="contactnumber" />
  15. <result property="documenttype" column="documenttype" />
  16. <result property="certificatenumber" column="certificatenumber" />
  17. <result property="authStime" column="auth_stime" />
  18. <result property="authEtime" column="auth_etime" />
  19. <result property="remarks" column="remarks" />
  20. <result property="adminId" column="admin_id" />
  21. <result property="createtime" column="createtime" />
  22. <result property="updatetime" column="updatetime" />
  23. <result property="state" column="state" />
  24. <result property="unitId" column="unit_id" />
  25. <result property="cutoffTime" column="cutoff_time" />
  26. <result property="outType" column="out_type" />
  27. </resultMap>
  28. <sql id="selectBdglPrivateCarVo">
  29. select id, vehiclecategory, people_id, people_name, vehiclenumber, vehiclecolor, vehiclemodel, contactnumber, documenttype, certificatenumber, auth_stime, auth_etime, remarks, admin_id, createtime, updatetime, state, unit_id, cutoff_time, out_type from bdgl_private_car
  30. </sql>
  31. <select id="selectBdglPrivateCarList" parameterType="BdglPrivateCar" resultMap="BdglPrivateCarResult">
  32. <include refid="selectBdglPrivateCarVo"/>
  33. <where>
  34. <if test="vehiclecategory != null and vehiclecategory != ''"> and vehiclecategory = #{vehiclecategory}</if>
  35. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  36. <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
  37. <if test="vehiclenumber != null and vehiclenumber != ''"> and vehiclenumber = #{vehiclenumber}</if>
  38. <if test="vehiclecolor != null and vehiclecolor != ''"> and vehiclecolor = #{vehiclecolor}</if>
  39. <if test="vehiclemodel != null and vehiclemodel != ''"> and vehiclemodel = #{vehiclemodel}</if>
  40. <if test="contactnumber != null and contactnumber != ''"> and contactnumber = #{contactnumber}</if>
  41. <if test="documenttype != null and documenttype != ''"> and documenttype = #{documenttype}</if>
  42. <if test="certificatenumber != null and certificatenumber != ''"> and certificatenumber = #{certificatenumber}</if>
  43. <if test="authStime != null "> and auth_stime = #{authStime}</if>
  44. <if test="authEtime != null "> and auth_etime = #{authEtime}</if>
  45. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  46. <if test="adminId != null "> and admin_id = #{adminId}</if>
  47. <if test="createtime != null and createtime != ''"> and createtime = #{createtime}</if>
  48. <if test="updatetime != null and updatetime != ''"> and updatetime = #{updatetime}</if>
  49. <if test="state != null and state != ''"> and state = #{state}</if>
  50. <if test="unitId != null "> and unit_id = #{unitId}</if>
  51. <if test="cutoffTime != null "> and cutoff_time = #{cutoffTime}</if>
  52. <if test="outType != null and outType != ''"> and out_type = #{outType}</if>
  53. </where>
  54. </select>
  55. <select id="selectBdglPrivateCarById" parameterType="Long" resultMap="BdglPrivateCarResult">
  56. <include refid="selectBdglPrivateCarVo"/>
  57. where id = #{id}
  58. </select>
  59. <select id="selectBdglPrivateCarLists" resultMap="BdglPrivateCarResult">
  60. select id, vehiclecategory, people_id, people_name, vehiclenumber, vehiclecolor, vehiclemodel, contactnumber, documenttype, certificatenumber, auth_stime, auth_etime, remarks, admin_id, createtime, updatetime, state, unit_id, cutoff_time, out_type
  61. from bdgl_private_car a
  62. left join sys_dept t
  63. on a.unit_id=t.dept_id
  64. <where>
  65. <if test="unitId != null ">
  66. and (a.unit_id=#{unitId} or t.ancestors LIKE concat('%', #{unitId}, '%'))
  67. </if>
  68. <if test="vehiclecategory != null and vehiclecategory != ''"> and a.vehiclecategory = #{vehiclecategory}</if>
  69. <if test="peopleId != null "> and a.people_id = #{peopleId}</if>
  70. <if test="peopleName != null and peopleName != ''"> and a.people_name like concat('%', #{peopleName}, '%')</if>
  71. <if test="vehiclenumber != null and vehiclenumber != ''"> and a.vehiclenumber = #{vehiclenumber}</if>
  72. <if test="vehiclecolor != null and vehiclecolor != ''"> and a.vehiclecolor = #{vehiclecolor}</if>
  73. <if test="vehiclemodel != null and vehiclemodel != ''"> and a.vehiclemodel = #{vehiclemodel}</if>
  74. <if test="contactnumber != null and contactnumber != ''"> and a.contactnumber = #{contactnumber}</if>
  75. <if test="documenttype != null and documenttype != ''"> and a.documenttype = #{documenttype}</if>
  76. <if test="certificatenumber != null and certificatenumber != ''"> and a.certificatenumber = #{certificatenumber}</if>
  77. <if test="authStime != null "> and a.auth_stime = #{authStime}</if>
  78. <if test="authEtime != null "> and a.auth_etime = #{authEtime}</if>
  79. <if test="remarks != null and remarks != ''"> and a.remarks = #{remarks}</if>
  80. <if test="adminId != null "> and admin_id = #{adminId}</if>
  81. <if test="createtime != null and createtime != ''"> and a.createtime = #{createtime}</if>
  82. <if test="updatetime != null and updatetime != ''"> and a.updatetime = #{updatetime}</if>
  83. <if test="state != null and state != ''"> and a.state = #{state}</if>
  84. <if test="cutoffTime != null "> and a.cutoff_time = #{cutoffTime}</if>
  85. <if test="outType != null and outType != ''"> and a.out_type = #{outType}</if>
  86. </where>
  87. order by id desc
  88. </select>
  89. <insert id="insertBdglPrivateCar" parameterType="BdglPrivateCar" useGeneratedKeys="true" keyProperty="id">
  90. insert into bdgl_private_car
  91. <trim prefix="(" suffix=")" suffixOverrides=",">
  92. <if test="vehiclecategory != null">vehiclecategory,</if>
  93. <if test="peopleId != null">people_id,</if>
  94. <if test="peopleName != null">people_name,</if>
  95. <if test="vehiclenumber != null">vehiclenumber,</if>
  96. <if test="vehiclecolor != null">vehiclecolor,</if>
  97. <if test="vehiclemodel != null">vehiclemodel,</if>
  98. <if test="contactnumber != null">contactnumber,</if>
  99. <if test="documenttype != null">documenttype,</if>
  100. <if test="certificatenumber != null">certificatenumber,</if>
  101. <if test="authStime != null">auth_stime,</if>
  102. <if test="authEtime != null">auth_etime,</if>
  103. <if test="remarks != null">remarks,</if>
  104. <if test="adminId != null">admin_id,</if>
  105. <if test="createtime != null">createtime,</if>
  106. <if test="updatetime != null">updatetime,</if>
  107. <if test="state != null">state,</if>
  108. <if test="unitId != null">unit_id,</if>
  109. <if test="cutoffTime != null">cutoff_time,</if>
  110. <if test="outType != null">out_type,</if>
  111. </trim>
  112. <trim prefix="values (" suffix=")" suffixOverrides=",">
  113. <if test="vehiclecategory != null">#{vehiclecategory},</if>
  114. <if test="peopleId != null">#{peopleId},</if>
  115. <if test="peopleName != null">#{peopleName},</if>
  116. <if test="vehiclenumber != null">#{vehiclenumber},</if>
  117. <if test="vehiclecolor != null">#{vehiclecolor},</if>
  118. <if test="vehiclemodel != null">#{vehiclemodel},</if>
  119. <if test="contactnumber != null">#{contactnumber},</if>
  120. <if test="documenttype != null">#{documenttype},</if>
  121. <if test="certificatenumber != null">#{certificatenumber},</if>
  122. <if test="authStime != null">#{authStime},</if>
  123. <if test="authEtime != null">#{authEtime},</if>
  124. <if test="remarks != null">#{remarks},</if>
  125. <if test="adminId != null">#{adminId},</if>
  126. <if test="createtime != null">#{createtime},</if>
  127. <if test="updatetime != null">#{updatetime},</if>
  128. <if test="state != null">#{state},</if>
  129. <if test="unitId != null">#{unitId},</if>
  130. <if test="cutoffTime != null">#{cutoffTime},</if>
  131. <if test="outType != null">#{outType},</if>
  132. </trim>
  133. </insert>
  134. <update id="updateBdglPrivateCar" parameterType="BdglPrivateCar">
  135. update bdgl_private_car
  136. <trim prefix="SET" suffixOverrides=",">
  137. <if test="vehiclecategory != null">vehiclecategory = #{vehiclecategory},</if>
  138. <if test="peopleId != null">people_id = #{peopleId},</if>
  139. <if test="peopleName != null">people_name = #{peopleName},</if>
  140. <if test="vehiclenumber != null">vehiclenumber = #{vehiclenumber},</if>
  141. <if test="vehiclecolor != null">vehiclecolor = #{vehiclecolor},</if>
  142. <if test="vehiclemodel != null">vehiclemodel = #{vehiclemodel},</if>
  143. <if test="contactnumber != null">contactnumber = #{contactnumber},</if>
  144. <if test="documenttype != null">documenttype = #{documenttype},</if>
  145. <if test="certificatenumber != null">certificatenumber = #{certificatenumber},</if>
  146. <if test="authStime != null">auth_stime = #{authStime},</if>
  147. <if test="authEtime != null">auth_etime = #{authEtime},</if>
  148. <if test="remarks != null">remarks = #{remarks},</if>
  149. <if test="adminId != null">admin_id = #{adminId},</if>
  150. <if test="createtime != null">createtime = #{createtime},</if>
  151. <if test="updatetime != null">updatetime = #{updatetime},</if>
  152. <if test="state != null">state = #{state},</if>
  153. <if test="unitId != null">unit_id = #{unitId},</if>
  154. <if test="cutoffTime != null">cutoff_time = #{cutoffTime},</if>
  155. <if test="outType != null">out_type = #{outType},</if>
  156. </trim>
  157. where id = #{id}
  158. </update>
  159. <delete id="deleteBdglPrivateCarById" parameterType="Long">
  160. delete from bdgl_private_car where id = #{id}
  161. </delete>
  162. <delete id="deleteBdglPrivateCarByIds" parameterType="String">
  163. delete from bdgl_private_car where id in
  164. <foreach item="id" collection="array" open="(" separator="," close=")">
  165. #{id}
  166. </foreach>
  167. </delete>
  168. </mapper>