BdglBasedutyMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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.combatduty.mapper.BdglBasedutyMapper">
  6. <resultMap type="BdglBaseduty" id="BdglBasedutyResult">
  7. <result property="id" column="id" />
  8. <result property="attendedTime" column="attended_time" />
  9. <result property="chiefDutyName" column="chief_duty_name" />
  10. <result property="chiefDutyId" column="chief_duty_id" />
  11. <result property="chiefDutyPhone" column="chief_duty_phone" />
  12. <result property="combatDutyName" column="combat_duty_name" />
  13. <result property="combatDutyId" column="combat_duty_id" />
  14. <result property="combatDutyPhone" column="combat_duty_phone" />
  15. <result property="dutyOffierName" column="duty_offier_name" />
  16. <result property="dutyOffierId" column="duty_offier_id" />
  17. <result property="dutyOffierPhone" column="duty_offier_phone" />
  18. <result property="detachmentoneName" column="detachmentone_name" />
  19. <result property="detachmentoneId" column="detachmentone_id" />
  20. <result property="detachmentoneNumber" column="detachmentone_number" />
  21. <result property="detachmentonePeopleName" column="detachmentone_people_name" />
  22. <result property="detachmentonePeopleId" column="detachmentone_people_id" />
  23. <result property="detachmentonePeoplePhone" column="detachmentone_people_phone" />
  24. <result property="detachmentwoName" column="detachmentwo_name" />
  25. <result property="detachmentwoId" column="detachmentwo_id" />
  26. <result property="detachmentwoNumber" column="detachmentwo_number" />
  27. <result property="detachmentwoPeopleName" column="detachmentwo_people_name" />
  28. <result property="detachmentwoPeopleId" column="detachmentwo_people_id" />
  29. <result property="detachmentwoPeoplePhone" column="detachmentwo_people_phone" />
  30. <result property="remarks" column="remarks" />
  31. </resultMap>
  32. <sql id="selectBdglBasedutyVo">
  33. select id, attended_time, chief_duty_name, chief_duty_id, chief_duty_phone, combat_duty_name, combat_duty_id, combat_duty_phone, duty_offier_name, duty_offier_id, duty_offier_phone, detachmentone_name, detachmentone_id, detachmentone_number, detachmentone_people_name, detachmentone_people_id, detachmentone_people_phone, detachmentwo_name, detachmentwo_id, detachmentwo_number, detachmentwo_people_name, detachmentwo_people_id, detachmentwo_people_phone, remarks from bdgl_baseduty
  34. </sql>
  35. <select id="selectBdglBasedutyList" parameterType="BdglBaseduty" resultMap="BdglBasedutyResult">
  36. <include refid="selectBdglBasedutyVo"/>
  37. <where>
  38. <if test="attendedTime != null and attendedTime != ''"> and attended_time = #{attendedTime}</if>
  39. <if test="chiefDutyName != null and chiefDutyName != ''"> and chief_duty_name like concat('%', #{chiefDutyName}, '%')</if>
  40. <if test="chiefDutyId != null "> and chief_duty_id = #{chiefDutyId}</if>
  41. <if test="chiefDutyPhone != null and chiefDutyPhone != ''"> and chief_duty_phone = #{chiefDutyPhone}</if>
  42. <if test="combatDutyName != null and combatDutyName != ''"> and combat_duty_name like concat('%', #{combatDutyName}, '%')</if>
  43. <if test="combatDutyId != null "> and combat_duty_id = #{combatDutyId}</if>
  44. <if test="combatDutyPhone != null and combatDutyPhone != ''"> and combat_duty_phone = #{combatDutyPhone}</if>
  45. <if test="dutyOffierName != null and dutyOffierName != ''"> and duty_offier_name like concat('%', #{dutyOffierName}, '%')</if>
  46. <if test="dutyOffierId != null "> and duty_offier_id = #{dutyOffierId}</if>
  47. <if test="dutyOffierPhone != null and dutyOffierPhone != ''"> and duty_offier_phone = #{dutyOffierPhone}</if>
  48. <if test="detachmentoneName != null and detachmentoneName != ''"> and detachmentone_name like concat('%', #{detachmentoneName}, '%')</if>
  49. <if test="detachmentoneId != null "> and detachmentone_id = #{detachmentoneId}</if>
  50. <if test="detachmentoneNumber != null "> and detachmentone_number = #{detachmentoneNumber}</if>
  51. <if test="detachmentonePeopleName != null and detachmentonePeopleName != ''"> and detachmentone_people_name like concat('%', #{detachmentonePeopleName}, '%')</if>
  52. <if test="detachmentonePeopleId != null "> and detachmentone_people_id = #{detachmentonePeopleId}</if>
  53. <if test="detachmentonePeoplePhone != null and detachmentonePeoplePhone != ''"> and detachmentone_people_phone = #{detachmentonePeoplePhone}</if>
  54. <if test="detachmentwoName != null and detachmentwoName != ''"> and detachmentwo_name like concat('%', #{detachmentwoName}, '%')</if>
  55. <if test="detachmentwoId != null "> and detachmentwo_id = #{detachmentwoId}</if>
  56. <if test="detachmentwoNumber != null "> and detachmentwo_number = #{detachmentwoNumber}</if>
  57. <if test="detachmentwoPeopleName != null and detachmentwoPeopleName != ''"> and detachmentwo_people_name like concat('%', #{detachmentwoPeopleName}, '%')</if>
  58. <if test="detachmentwoPeopleId != null "> and detachmentwo_people_id = #{detachmentwoPeopleId}</if>
  59. <if test="detachmentwoPeoplePhone != null and detachmentwoPeoplePhone != ''"> and detachmentwo_people_phone = #{detachmentwoPeoplePhone}</if>
  60. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  61. <if test="attendedTimeGe != null"> and attended_time &gt;= #{attendedTimeGe}</if>
  62. <if test="attendedTimeLe != null"> and attended_time &lt;= #{attendedTimeLe}</if>
  63. </where>
  64. order by id desc
  65. </select>
  66. <select id="selectBdglBasedutyById" parameterType="Long" resultMap="BdglBasedutyResult">
  67. <include refid="selectBdglBasedutyVo"/>
  68. where id = #{id}
  69. </select>
  70. <insert id="insertBdglBaseduty" parameterType="BdglBaseduty">
  71. insert into bdgl_baseduty
  72. <trim prefix="(" suffix=")" suffixOverrides=",">
  73. <if test="id != null">id,</if>
  74. <if test="attendedTime != null">attended_time,</if>
  75. <if test="chiefDutyName != null">chief_duty_name,</if>
  76. <if test="chiefDutyId != null">chief_duty_id,</if>
  77. <if test="chiefDutyPhone != null">chief_duty_phone,</if>
  78. <if test="combatDutyName != null">combat_duty_name,</if>
  79. <if test="combatDutyId != null">combat_duty_id,</if>
  80. <if test="combatDutyPhone != null">combat_duty_phone,</if>
  81. <if test="dutyOffierName != null">duty_offier_name,</if>
  82. <if test="dutyOffierId != null">duty_offier_id,</if>
  83. <if test="dutyOffierPhone != null">duty_offier_phone,</if>
  84. <if test="detachmentoneName != null">detachmentone_name,</if>
  85. <if test="detachmentoneId != null">detachmentone_id,</if>
  86. <if test="detachmentoneNumber != null">detachmentone_number,</if>
  87. <if test="detachmentonePeopleName != null">detachmentone_people_name,</if>
  88. <if test="detachmentonePeopleId != null">detachmentone_people_id,</if>
  89. <if test="detachmentonePeoplePhone != null">detachmentone_people_phone,</if>
  90. <if test="detachmentwoName != null">detachmentwo_name,</if>
  91. <if test="detachmentwoId != null">detachmentwo_id,</if>
  92. <if test="detachmentwoNumber != null">detachmentwo_number,</if>
  93. <if test="detachmentwoPeopleName != null">detachmentwo_people_name,</if>
  94. <if test="detachmentwoPeopleId != null">detachmentwo_people_id,</if>
  95. <if test="detachmentwoPeoplePhone != null">detachmentwo_people_phone,</if>
  96. <if test="remarks != null">remarks,</if>
  97. </trim>
  98. <trim prefix="values (" suffix=")" suffixOverrides=",">
  99. <if test="id != null">#{id},</if>
  100. <if test="attendedTime != null">#{attendedTime},</if>
  101. <if test="chiefDutyName != null">#{chiefDutyName},</if>
  102. <if test="chiefDutyId != null">#{chiefDutyId},</if>
  103. <if test="chiefDutyPhone != null">#{chiefDutyPhone},</if>
  104. <if test="combatDutyName != null">#{combatDutyName},</if>
  105. <if test="combatDutyId != null">#{combatDutyId},</if>
  106. <if test="combatDutyPhone != null">#{combatDutyPhone},</if>
  107. <if test="dutyOffierName != null">#{dutyOffierName},</if>
  108. <if test="dutyOffierId != null">#{dutyOffierId},</if>
  109. <if test="dutyOffierPhone != null">#{dutyOffierPhone},</if>
  110. <if test="detachmentoneName != null">#{detachmentoneName},</if>
  111. <if test="detachmentoneId != null">#{detachmentoneId},</if>
  112. <if test="detachmentoneNumber != null">#{detachmentoneNumber},</if>
  113. <if test="detachmentonePeopleName != null">#{detachmentonePeopleName},</if>
  114. <if test="detachmentonePeopleId != null">#{detachmentonePeopleId},</if>
  115. <if test="detachmentonePeoplePhone != null">#{detachmentonePeoplePhone},</if>
  116. <if test="detachmentwoName != null">#{detachmentwoName},</if>
  117. <if test="detachmentwoId != null">#{detachmentwoId},</if>
  118. <if test="detachmentwoNumber != null">#{detachmentwoNumber},</if>
  119. <if test="detachmentwoPeopleName != null">#{detachmentwoPeopleName},</if>
  120. <if test="detachmentwoPeopleId != null">#{detachmentwoPeopleId},</if>
  121. <if test="detachmentwoPeoplePhone != null">#{detachmentwoPeoplePhone},</if>
  122. <if test="remarks != null">#{remarks},</if>
  123. </trim>
  124. </insert>
  125. <update id="updateBdglBaseduty" parameterType="BdglBaseduty">
  126. update bdgl_baseduty
  127. <trim prefix="SET" suffixOverrides=",">
  128. <if test="attendedTime != null">attended_time = #{attendedTime},</if>
  129. <if test="chiefDutyName != null">chief_duty_name = #{chiefDutyName},</if>
  130. <if test="chiefDutyId != null">chief_duty_id = #{chiefDutyId},</if>
  131. <if test="chiefDutyPhone != null">chief_duty_phone = #{chiefDutyPhone},</if>
  132. <if test="combatDutyName != null">combat_duty_name = #{combatDutyName},</if>
  133. <if test="combatDutyId != null">combat_duty_id = #{combatDutyId},</if>
  134. <if test="combatDutyPhone != null">combat_duty_phone = #{combatDutyPhone},</if>
  135. <if test="dutyOffierName != null">duty_offier_name = #{dutyOffierName},</if>
  136. <if test="dutyOffierId != null">duty_offier_id = #{dutyOffierId},</if>
  137. <if test="dutyOffierPhone != null">duty_offier_phone = #{dutyOffierPhone},</if>
  138. <if test="detachmentoneName != null">detachmentone_name = #{detachmentoneName},</if>
  139. <if test="detachmentoneId != null">detachmentone_id = #{detachmentoneId},</if>
  140. <if test="detachmentoneNumber != null">detachmentone_number = #{detachmentoneNumber},</if>
  141. <if test="detachmentonePeopleName != null">detachmentone_people_name = #{detachmentonePeopleName},</if>
  142. <if test="detachmentonePeopleId != null">detachmentone_people_id = #{detachmentonePeopleId},</if>
  143. <if test="detachmentonePeoplePhone != null">detachmentone_people_phone = #{detachmentonePeoplePhone},</if>
  144. <if test="detachmentwoName != null">detachmentwo_name = #{detachmentwoName},</if>
  145. <if test="detachmentwoId != null">detachmentwo_id = #{detachmentwoId},</if>
  146. <if test="detachmentwoNumber != null">detachmentwo_number = #{detachmentwoNumber},</if>
  147. <if test="detachmentwoPeopleName != null">detachmentwo_people_name = #{detachmentwoPeopleName},</if>
  148. <if test="detachmentwoPeopleId != null">detachmentwo_people_id = #{detachmentwoPeopleId},</if>
  149. <if test="detachmentwoPeoplePhone != null">detachmentwo_people_phone = #{detachmentwoPeoplePhone},</if>
  150. <if test="remarks != null">remarks = #{remarks},</if>
  151. </trim>
  152. where id = #{id}
  153. </update>
  154. <delete id="deleteBdglBasedutyById" parameterType="Long">
  155. delete from bdgl_baseduty where id = #{id}
  156. </delete>
  157. <delete id="deleteBdglBasedutyByIds" parameterType="String">
  158. delete from bdgl_baseduty where id in
  159. <foreach item="id" collection="array" open="(" separator="," close=")">
  160. #{id}
  161. </foreach>
  162. </delete>
  163. </mapper>