BdglTeamdutyFuMapper.xml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.BdglTeamdutyFuMapper">
  6. <resultMap type="BdglTeamdutyFu" id="BdglTeamdutyFuResult">
  7. <result property="id" column="id" />
  8. <result property="detachmentName" column="detachment_name" />
  9. <result property="detachmentId" column="detachment_id" />
  10. <result property="detachmentNumber" column="detachment_number" />
  11. <result property="detachmentPeopleName" column="detachment_people_name" />
  12. <result property="detachmentPeopleId" column="detachment_people_id" />
  13. <result property="detachmentPeoplePhone" column="detachment_people_phone" />
  14. <result property="bdglTeamdutyId" column="bdgl_teamduty_id" />
  15. </resultMap>
  16. <sql id="selectBdglTeamdutyFuVo">
  17. select id, detachment_name, detachment_id, detachment_number, detachment_people_name, detachment_people_id, detachment_people_phone, bdgl_teamduty_id from bdgl_teamduty_fu
  18. </sql>
  19. <select id="selectBdglTeamdutyFuList" parameterType="BdglTeamdutyFu" resultMap="BdglTeamdutyFuResult">
  20. <include refid="selectBdglTeamdutyFuVo"/>
  21. <where>
  22. <if test="detachmentName != null and detachmentName != ''"> and detachment_name like concat('%', #{detachmentName}, '%')</if>
  23. <if test="detachmentId != null "> and detachment_id = #{detachmentId}</if>
  24. <if test="detachmentNumber != null "> and detachment_number = #{detachmentNumber}</if>
  25. <if test="detachmentPeopleName != null and detachmentPeopleName != ''"> and detachment_people_name like concat('%', #{detachmentPeopleName}, '%')</if>
  26. <if test="detachmentPeopleId != null "> and detachment_people_id = #{detachmentPeopleId}</if>
  27. <if test="detachmentPeoplePhone != null and detachmentPeoplePhone != ''"> and detachment_people_phone = #{detachmentPeoplePhone}</if>
  28. <if test="bdglTeamdutyId != null "> and bdgl_teamduty_id = #{bdglTeamdutyId}</if>
  29. </where>
  30. </select>
  31. <select id="selectBdglTeamdutyFuById" parameterType="Long" resultMap="BdglTeamdutyFuResult">
  32. <include refid="selectBdglTeamdutyFuVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertBdglTeamdutyFu" parameterType="BdglTeamdutyFu" useGeneratedKeys="true" keyProperty="id">
  36. insert into bdgl_teamduty_fu
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="detachmentName != null">detachment_name,</if>
  39. <if test="detachmentId != null">detachment_id,</if>
  40. <if test="detachmentNumber != null">detachment_number,</if>
  41. <if test="detachmentPeopleName != null">detachment_people_name,</if>
  42. <if test="detachmentPeopleId != null">detachment_people_id,</if>
  43. <if test="detachmentPeoplePhone != null">detachment_people_phone,</if>
  44. <if test="bdglTeamdutyId != null">bdgl_teamduty_id,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="detachmentName != null">#{detachmentName},</if>
  48. <if test="detachmentId != null">#{detachmentId},</if>
  49. <if test="detachmentNumber != null">#{detachmentNumber},</if>
  50. <if test="detachmentPeopleName != null">#{detachmentPeopleName},</if>
  51. <if test="detachmentPeopleId != null">#{detachmentPeopleId},</if>
  52. <if test="detachmentPeoplePhone != null">#{detachmentPeoplePhone},</if>
  53. <if test="bdglTeamdutyId != null">#{bdglTeamdutyId},</if>
  54. </trim>
  55. </insert>
  56. <update id="updateBdglTeamdutyFu" parameterType="BdglTeamdutyFu">
  57. update bdgl_teamduty_fu
  58. <trim prefix="SET" suffixOverrides=",">
  59. <if test="detachmentName != null">detachment_name = #{detachmentName},</if>
  60. <if test="detachmentId != null">detachment_id = #{detachmentId},</if>
  61. <if test="detachmentNumber != null">detachment_number = #{detachmentNumber},</if>
  62. <if test="detachmentPeopleName != null">detachment_people_name = #{detachmentPeopleName},</if>
  63. <if test="detachmentPeopleId != null">detachment_people_id = #{detachmentPeopleId},</if>
  64. <if test="detachmentPeoplePhone != null">detachment_people_phone = #{detachmentPeoplePhone},</if>
  65. <if test="bdglTeamdutyId != null">bdgl_teamduty_id = #{bdglTeamdutyId},</if>
  66. </trim>
  67. where id = #{id}
  68. </update>
  69. <delete id="deleteBdglTeamdutyFuById" parameterType="Long">
  70. delete from bdgl_teamduty_fu where id = #{id}
  71. </delete>
  72. <delete id="deleteBdglTeamdutyFuByIds" parameterType="String">
  73. delete from bdgl_teamduty_fu where id in
  74. <foreach item="id" collection="array" open="(" separator="," close=")">
  75. #{id}
  76. </foreach>
  77. </delete>
  78. </mapper>