BdglDriverMapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.BdglDriverMapper">
  6. <resultMap type="BdglDriver" id="BdglDriverResult">
  7. <result property="id" column="id" />
  8. <result property="peopleId" column="people_id" />
  9. <result property="unitId" column="unit_id" />
  10. <result property="contact" column="contact" />
  11. <result property="driversLicense" column="drivers_license" />
  12. <result property="birthDate" column="birth_date" />
  13. <result property="enlistDate" column="enlist_date" />
  14. <result property="sexList" column="sex_list" />
  15. <result property="rankId" column="rank_id" />
  16. <result property="drivingAge" column="driving_age" />
  17. <result property="drivingModel" column="driving_model" />
  18. <result property="chulingriq" column="chulingriq" />
  19. <result property="hefariqi" column="hefariqi" />
  20. <result property="result" column="result" />
  21. <result property="youxiaoriqi" column="youxiaoriqi" />
  22. <result property="vocationalSkills" column="vocational_skills" />
  23. <result property="createtime" column="createtime" />
  24. <result property="updatetime" column="updatetime" />
  25. <result property="peopleName" column="people_name" />
  26. <result property="unitName" column="unit_name" />
  27. </resultMap>
  28. <sql id="selectBdglDriverVo">
  29. select id, people_id, unit_id, contact, drivers_license, birth_date, enlist_date, sex_list, rank_id, driving_age, driving_model, chulingriq, hefariqi, result, youxiaoriqi, vocational_skills, createtime, updatetime, people_name, unit_name from bdgl_driver
  30. </sql>
  31. <select id="selectBdglDriverList" parameterType="BdglDriver" resultMap="BdglDriverResult">
  32. <include refid="selectBdglDriverVo"/>
  33. <where>
  34. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  35. <if test="unitId != null "> and unit_id = #{unitId}</if>
  36. <if test="contact != null and contact != ''"> and contact = #{contact}</if>
  37. <if test="driversLicense != null and driversLicense != ''"> and drivers_license = #{driversLicense}</if>
  38. <if test="birthDate != null and birthDate != ''"> and birth_date = #{birthDate}</if>
  39. <if test="enlistDate != null and enlistDate != ''"> and enlist_date = #{enlistDate}</if>
  40. <if test="sexList != null and sexList != ''"> and sex_list = #{sexList}</if>
  41. <if test="rankId != null "> and rank_id = #{rankId}</if>
  42. <if test="drivingAge != null "> and driving_age = #{drivingAge}</if>
  43. <if test="drivingModel != null and drivingModel != ''"> and driving_model = #{drivingModel}</if>
  44. <if test="chulingriq != null "> and chulingriq = #{chulingriq}</if>
  45. <if test="hefariqi != null "> and hefariqi = #{hefariqi}</if>
  46. <if test="result != null and result != ''"> and result = #{result}</if>
  47. <if test="youxiaoriqi != null "> and youxiaoriqi = #{youxiaoriqi}</if>
  48. <if test="vocationalSkills != null and vocationalSkills != ''"> and vocational_skills = #{vocationalSkills}</if>
  49. <if test="createtime != null "> and createtime = #{createtime}</if>
  50. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  51. <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
  52. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  53. </where>
  54. order by id desc
  55. </select>
  56. <select id="selectBdglDriverById" parameterType="Integer" resultMap="BdglDriverResult">
  57. <include refid="selectBdglDriverVo"/>
  58. where id = #{id}
  59. </select>
  60. <insert id="insertBdglDriver" parameterType="BdglDriver" useGeneratedKeys="true" keyProperty="id">
  61. insert into bdgl_driver
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="peopleId != null">people_id,</if>
  64. <if test="unitId != null">unit_id,</if>
  65. <if test="contact != null">contact,</if>
  66. <if test="driversLicense != null">drivers_license,</if>
  67. <if test="birthDate != null">birth_date,</if>
  68. <if test="enlistDate != null">enlist_date,</if>
  69. <if test="sexList != null">sex_list,</if>
  70. <if test="rankId != null">rank_id,</if>
  71. <if test="drivingAge != null">driving_age,</if>
  72. <if test="drivingModel != null">driving_model,</if>
  73. <if test="chulingriq != null">chulingriq,</if>
  74. <if test="hefariqi != null">hefariqi,</if>
  75. <if test="result != null">result,</if>
  76. <if test="youxiaoriqi != null">youxiaoriqi,</if>
  77. <if test="vocationalSkills != null">vocational_skills,</if>
  78. <if test="createtime != null">createtime,</if>
  79. <if test="updatetime != null">updatetime,</if>
  80. <if test="peopleName != null">people_name,</if>
  81. <if test="unitName != null">unit_name,</if>
  82. </trim>
  83. <trim prefix="values (" suffix=")" suffixOverrides=",">
  84. <if test="peopleId != null">#{peopleId},</if>
  85. <if test="unitId != null">#{unitId},</if>
  86. <if test="contact != null">#{contact},</if>
  87. <if test="driversLicense != null">#{driversLicense},</if>
  88. <if test="birthDate != null">#{birthDate},</if>
  89. <if test="enlistDate != null">#{enlistDate},</if>
  90. <if test="sexList != null">#{sexList},</if>
  91. <if test="rankId != null">#{rankId},</if>
  92. <if test="drivingAge != null">#{drivingAge},</if>
  93. <if test="drivingModel != null">#{drivingModel},</if>
  94. <if test="chulingriq != null">#{chulingriq},</if>
  95. <if test="hefariqi != null">#{hefariqi},</if>
  96. <if test="result != null">#{result},</if>
  97. <if test="youxiaoriqi != null">#{youxiaoriqi},</if>
  98. <if test="vocationalSkills != null">#{vocationalSkills},</if>
  99. <if test="createtime != null">#{createtime},</if>
  100. <if test="updatetime != null">#{updatetime},</if>
  101. <if test="peopleName != null">#{peopleName},</if>
  102. <if test="unitName != null">#{unitName},</if>
  103. </trim>
  104. </insert>
  105. <update id="updateBdglDriver" parameterType="BdglDriver">
  106. update bdgl_driver
  107. <trim prefix="SET" suffixOverrides=",">
  108. <if test="peopleId != null">people_id = #{peopleId},</if>
  109. <if test="unitId != null">unit_id = #{unitId},</if>
  110. <if test="contact != null">contact = #{contact},</if>
  111. <if test="driversLicense != null">drivers_license = #{driversLicense},</if>
  112. <if test="birthDate != null">birth_date = #{birthDate},</if>
  113. <if test="enlistDate != null">enlist_date = #{enlistDate},</if>
  114. <if test="sexList != null">sex_list = #{sexList},</if>
  115. <if test="rankId != null">rank_id = #{rankId},</if>
  116. <if test="drivingAge != null">driving_age = #{drivingAge},</if>
  117. <if test="drivingModel != null">driving_model = #{drivingModel},</if>
  118. <if test="chulingriq != null">chulingriq = #{chulingriq},</if>
  119. <if test="hefariqi != null">hefariqi = #{hefariqi},</if>
  120. <if test="result != null">result = #{result},</if>
  121. <if test="youxiaoriqi != null">youxiaoriqi = #{youxiaoriqi},</if>
  122. <if test="vocationalSkills != null">vocational_skills = #{vocationalSkills},</if>
  123. <if test="createtime != null">createtime = #{createtime},</if>
  124. <if test="updatetime != null">updatetime = #{updatetime},</if>
  125. <if test="peopleName != null">people_name = #{peopleName},</if>
  126. <if test="unitName != null">unit_name = #{unitName},</if>
  127. </trim>
  128. where id = #{id}
  129. </update>
  130. <delete id="deleteBdglDriverById" parameterType="Integer">
  131. delete from bdgl_driver where id = #{id}
  132. </delete>
  133. <delete id="deleteBdglDriverByIds" parameterType="String">
  134. delete from bdgl_driver where id in
  135. <foreach item="id" collection="array" open="(" separator="," close=")">
  136. #{id}
  137. </foreach>
  138. </delete>
  139. </mapper>