FleetDriverMsgMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.ruoyi.basicData.mapper.FleetDriverMsgMapper">
  6. <resultMap type="FleetDriverMsg" id="FleetDriverMsgResult">
  7. <result property="id" column="id" />
  8. <result property="fleetCompanyId" column="fleet_company_id" />
  9. <result property="name" column="name" />
  10. <result property="sex" column="sex" />
  11. <result property="birthday" column="birthday" />
  12. <result property="allowDriverCar" column="allow_driver_car" />
  13. <result property="firstCertificateDate" column="first_certificate_date" />
  14. <result property="idcarNum" column="idcar_num" />
  15. <result property="tel" column="tel" />
  16. <result property="address" column="address" />
  17. <result property="resumePic" column="resume_pic" />
  18. <result property="drivingPic" column="driving_pic" />
  19. <result property="creatTime" column="creat_time" />
  20. <result property="modificationTime" column="modification_time" />
  21. <result property="billStatus" column="bill_status" />
  22. <result property="delFlag" column="del_flag" />
  23. <result property="createBy" column="create_by" />
  24. <result property="updateBy" column="update_by" />
  25. <result property="updateTime" column="update_time" />
  26. <result property="remarks" column="remarks" />
  27. </resultMap>
  28. <sql id="selectFleetDriverMsgVo">
  29. select id, fleet_company_id, name, sex, birthday, allow_driver_car, first_certificate_date, idcar_num, tel, address, resume_pic, driving_pic, creat_time, modification_time, bill_status, del_flag, create_by, update_by, update_time, remarks from fleet_driver_msg
  30. </sql>
  31. <select id="selectFleetDriverMsgList" parameterType="FleetDriverMsg" resultMap="FleetDriverMsgResult">
  32. <include refid="selectFleetDriverMsgVo"/>
  33. <where>
  34. <if test="fleetCompanyId != null "> and fleet_company_id = #{fleetCompanyId}</if>
  35. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  36. <if test="sex != null "> and sex = #{sex}</if>
  37. <if test="birthday != null "> and birthday = #{birthday}</if>
  38. <if test="allowDriverCar != null and allowDriverCar != ''"> and allow_driver_car = #{allowDriverCar}</if>
  39. <if test="firstCertificateDate != null "> and first_certificate_date = #{firstCertificateDate}</if>
  40. <if test="idcarNum != null and idcarNum != ''"> and idcar_num = #{idcarNum}</if>
  41. <if test="tel != null and tel != ''"> and tel = #{tel}</if>
  42. <if test="address != null and address != ''"> and address = #{address}</if>
  43. <if test="resumePic != null and resumePic != ''"> and resume_pic = #{resumePic}</if>
  44. <if test="drivingPic != null and drivingPic != ''"> and driving_pic = #{drivingPic}</if>
  45. <if test="creatTime != null "> and creat_time = #{creatTime}</if>
  46. <if test="modificationTime != null "> and modification_time = #{modificationTime}</if>
  47. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  48. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  49. </where>
  50. </select>
  51. <select id="selectFleetDriverMsgIdNameList" resultType="FleetDriverMsg" resultMap="FleetDriverMsgResult">
  52. select id, fleet_company_id, name, tel from fleet_driver_msg
  53. <where>
  54. <if test="fPid != null "> and f_pid = #{fPid}</if>
  55. <if test="fleetCompanyId != null "> and fleet_company_id = #{fleetCompanyId}</if>
  56. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  57. <if test="sex != null "> and sex = #{sex}</if>
  58. <if test="birthday != null "> and birthday = #{birthday}</if>
  59. <if test="allowDriverCar != null and allowDriverCar != ''"> and allow_driver_car = #{allowDriverCar}</if>
  60. <if test="firstCertificateDate != null "> and first_certificate_date = #{firstCertificateDate}</if>
  61. <if test="idcarNum != null and idcarNum != ''"> and idcar_num = #{idcarNum}</if>
  62. <if test="tel != null and tel != ''"> and tel = #{tel}</if>
  63. <if test="address != null and address != ''"> and address = #{address}</if>
  64. <if test="resumePic != null and resumePic != ''"> and resume_pic = #{resumePic}</if>
  65. <if test="drivingPic != null and drivingPic != ''"> and driving_pic = #{drivingPic}</if>
  66. <if test="creatTime != null "> and creat_time = #{creatTime}</if>
  67. <if test="modificationTime != null "> and modification_time = #{modificationTime}</if>
  68. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  69. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  70. </where>
  71. </select>
  72. <select id="selectFleetDriverMsgById" parameterType="Long" resultMap="FleetDriverMsgResult">
  73. <include refid="selectFleetDriverMsgVo"/>
  74. where id = #{id}
  75. </select>
  76. <insert id="insertFleetDriverMsg" parameterType="FleetDriverMsg" useGeneratedKeys="true" keyProperty="id">
  77. insert into fleet_driver_msg
  78. <trim prefix="(" suffix=")" suffixOverrides=",">
  79. <if test="fleetCompanyId != null">fleet_company_id,</if>
  80. <if test="name != null">name,</if>
  81. <if test="sex != null">sex,</if>
  82. <if test="birthday != null">birthday,</if>
  83. <if test="allowDriverCar != null">allow_driver_car,</if>
  84. <if test="firstCertificateDate != null">first_certificate_date,</if>
  85. <if test="idcarNum != null">idcar_num,</if>
  86. <if test="tel != null">tel,</if>
  87. <if test="address != null">address,</if>
  88. <if test="resumePic != null">resume_pic,</if>
  89. <if test="drivingPic != null">driving_pic,</if>
  90. <if test="creatTime != null">creat_time,</if>
  91. <if test="modificationTime != null">modification_time,</if>
  92. <if test="billStatus != null">bill_status,</if>
  93. <if test="delFlag != null">del_flag,</if>
  94. <if test="createBy != null">create_by,</if>
  95. <if test="updateBy != null">update_by,</if>
  96. <if test="updateTime != null">update_time,</if>
  97. <if test="remarks != null">remarks,</if>
  98. </trim>
  99. <trim prefix="values (" suffix=")" suffixOverrides=",">
  100. <if test="fleetCompanyId != null">#{fleetCompanyId},</if>
  101. <if test="name != null">#{name},</if>
  102. <if test="sex != null">#{sex},</if>
  103. <if test="birthday != null">#{birthday},</if>
  104. <if test="allowDriverCar != null">#{allowDriverCar},</if>
  105. <if test="firstCertificateDate != null">#{firstCertificateDate},</if>
  106. <if test="idcarNum != null">#{idcarNum},</if>
  107. <if test="tel != null">#{tel},</if>
  108. <if test="address != null">#{address},</if>
  109. <if test="resumePic != null">#{resumePic},</if>
  110. <if test="drivingPic != null">#{drivingPic},</if>
  111. <if test="creatTime != null">#{creatTime},</if>
  112. <if test="modificationTime != null">#{modificationTime},</if>
  113. <if test="billStatus != null">#{billStatus},</if>
  114. <if test="delFlag != null">#{delFlag},</if>
  115. <if test="createBy != null">#{createBy},</if>
  116. <if test="updateBy != null">#{updateBy},</if>
  117. <if test="updateTime != null">#{updateTime},</if>
  118. <if test="remarks != null">#{remarks},</if>
  119. </trim>
  120. </insert>
  121. <update id="updateFleetDriverMsg" parameterType="FleetDriverMsg">
  122. update fleet_driver_msg
  123. <trim prefix="SET" suffixOverrides=",">
  124. <if test="fleetCompanyId != null">fleet_company_id = #{fleetCompanyId},</if>
  125. <if test="name != null">name = #{name},</if>
  126. <if test="sex != null">sex = #{sex},</if>
  127. <if test="birthday != null">birthday = #{birthday},</if>
  128. <if test="allowDriverCar != null">allow_driver_car = #{allowDriverCar},</if>
  129. <if test="firstCertificateDate != null">first_certificate_date = #{firstCertificateDate},</if>
  130. <if test="idcarNum != null">idcar_num = #{idcarNum},</if>
  131. <if test="tel != null">tel = #{tel},</if>
  132. <if test="address != null">address = #{address},</if>
  133. <if test="resumePic != null">resume_pic = #{resumePic},</if>
  134. <if test="drivingPic != null">driving_pic = #{drivingPic},</if>
  135. <if test="creatTime != null">creat_time = #{creatTime},</if>
  136. <if test="modificationTime != null">modification_time = #{modificationTime},</if>
  137. <if test="billStatus != null">bill_status = #{billStatus},</if>
  138. <if test="delFlag != null">del_flag = #{delFlag},</if>
  139. <if test="createBy != null">create_by = #{createBy},</if>
  140. <if test="updateBy != null">update_by = #{updateBy},</if>
  141. <if test="updateTime != null">update_time = #{updateTime},</if>
  142. <if test="remarks != null">remarks = #{remarks},</if>
  143. </trim>
  144. where id = #{id}
  145. </update>
  146. <delete id="deleteFleetDriverMsgById" parameterType="Long">
  147. delete from fleet_driver_msg where id = #{id}
  148. </delete>
  149. <delete id="deleteFleetDriverMsgByIds" parameterType="String">
  150. delete from fleet_driver_msg where id in
  151. <foreach item="id" collection="array" open="(" separator="," close=")">
  152. #{id}
  153. </foreach>
  154. </delete>
  155. <select id="selectFleetDriverMsgListMap" parameterType="FleetDriverMsg" resultType="Map">
  156. SELECT
  157. dri.id AS id,
  158. com.company_name AS companyName,
  159. dri.`name` AS `name`,
  160. dri.sex AS sex,
  161. dri.birthday AS birthday,
  162. dri.allow_driver_car AS allowDriverCar,
  163. dri.first_certificate_date AS firstCertificateDate,
  164. dri.idcar_num AS idcarNum,
  165. dri.tel AS tel,
  166. dri.address AS address,
  167. dri.resume_pic AS resumePic,
  168. dri.driving_pic AS drivingPic,
  169. dri.creat_time AS creatTime,
  170. dri.modification_time AS modificationTime,
  171. dri.bill_status AS billStatus,
  172. dri.del_flag,
  173. dri.create_by,
  174. dri.update_by,
  175. dri.update_time,
  176. dri.remarks AS remarks
  177. FROM
  178. fleet_driver_msg dri
  179. LEFT JOIN fleet_company_msg AS com ON dri.fleet_company_id = com.id
  180. <where>
  181. <if test="fleetCompanyId != null "> and dri.fleet_company_id = #{fleetCompanyId}</if>
  182. <if test="name != null and name != ''"> and dri.name like concat('%', #{name}, '%')</if>
  183. <if test="sex != null "> and dri.sex = #{sex}</if>
  184. <if test="birthday != null "> and dri.birthday = #{birthday}</if>
  185. <if test="allowDriverCar != null and allowDriverCar != ''"> and dri.allow_driver_car = #{allowDriverCar}</if>
  186. <if test="firstCertificateDate != null "> and dri.first_certificate_date = #{firstCertificateDate}</if>
  187. <if test="idcarNum != null and idcarNum != ''"> and dri.idcar_num = #{idcarNum}</if>
  188. <if test="tel != null and tel != ''"> and dri.tel = #{tel}</if>
  189. <if test="address != null and address != ''"> and dri.address = #{address}</if>
  190. <if test="resumePic != null and resumePic != ''"> and dri.resume_pic = #{resumePic}</if>
  191. <if test="drivingPic != null and drivingPic != ''"> and dri.driving_pic = #{drivingPic}</if>
  192. <if test="creatTime != null "> and dri.creat_time = #{creatTime}</if>
  193. <if test="modificationTime != null "> and dri.modification_time = #{modificationTime}</if>
  194. <if test="billStatus != null "> and dri.bill_status = #{billStatus}</if>
  195. <if test="remarks != null and remarks != ''"> and dri.remarks = #{remarks}</if>
  196. </where>
  197. </select>
  198. </mapper>