BdglPeopleTransferMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.peopleManage.mapper.BdglPeopleTransferMapper">
  6. <resultMap type="BdglPeopleTransfer" id="BdglPeopleTransferResult">
  7. <result property="id" column="id" />
  8. <result property="peopleId" column="people_id" />
  9. <result property="transferId" column="transfer_id" />
  10. <result property="transferDate" column="transfer_date" />
  11. <result property="transferTake" column="transfer_take" />
  12. <result property="militaryRank1" column="military_rank1" />
  13. <result property="militaryRank2" column="military_rank2" />
  14. <result property="post1" column="post1" />
  15. <result property="post2" column="post2" />
  16. <result property="unit1" column="unit1" />
  17. <result property="unit2" column="unit2" />
  18. <result property="aduty" column="aduty" />
  19. <result property="commandNumber" column="command_number" />
  20. <result property="reason" column="reason" />
  21. <result property="remark" column="remark" />
  22. <result property="field1" column="field1" />
  23. <result property="createtime" column="createtime" />
  24. <result property="updatetime" column="updatetime" />
  25. <result property="cName" column="c_name" />
  26. </resultMap>
  27. <sql id="selectBdglPeopleTransferVo">
  28. select id, people_id, transfer_id, transfer_date, transfer_take, military_rank1, military_rank2, post1, post2, unit1, unit2, aduty, command_number, reason, remark, field1, createtime, updatetime, c_name from bdgl_people_transfer
  29. </sql>
  30. <select id="selectBdglPeopleTransferList" parameterType="BdglPeopleTransfer" resultMap="BdglPeopleTransferResult">
  31. <include refid="selectBdglPeopleTransferVo"/>
  32. <where>
  33. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  34. <if test="transferId != null "> and transfer_id = #{transferId}</if>
  35. <if test="transferDate != null "> and transfer_date = #{transferDate}</if>
  36. <if test="transferTake != null "> and transfer_take = #{transferTake}</if>
  37. <if test="militaryRank1 != null and militaryRank1 != ''"> and military_rank1 = #{militaryRank1}</if>
  38. <if test="militaryRank2 != null and militaryRank2 != ''"> and military_rank2 = #{militaryRank2}</if>
  39. <if test="post1 != null and post1 != ''"> and post1 = #{post1}</if>
  40. <if test="post2 != null and post2 != ''"> and post2 = #{post2}</if>
  41. <if test="unit1 != null and unit1 != ''"> and unit1 = #{unit1}</if>
  42. <if test="unit2 != null and unit2 != ''"> and unit2 = #{unit2}</if>
  43. <if test="aduty != null and aduty != ''"> and aduty = #{aduty}</if>
  44. <if test="commandNumber != null and commandNumber != ''"> and command_number = #{commandNumber}</if>
  45. <if test="reason != null and reason != ''"> and reason = #{reason}</if>
  46. <if test="field1 != null and field1 != ''"> and field1 = #{field1}</if>
  47. <if test="createtime != null "> and createtime = #{createtime}</if>
  48. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  49. <if test="cName != null and cName != ''"> and c_name like concat('%', #{cName}, '%')</if>
  50. </where>
  51. </select>
  52. <select id="selectBdglPeopleTransferById" parameterType="Integer" resultMap="BdglPeopleTransferResult">
  53. <include refid="selectBdglPeopleTransferVo"/>
  54. where id = #{id}
  55. </select>
  56. <insert id="insertBdglPeopleTransfer" parameterType="BdglPeopleTransfer" useGeneratedKeys="true" keyProperty="id">
  57. insert into bdgl_people_transfer
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="peopleId != null">people_id,</if>
  60. <if test="transferId != null">transfer_id,</if>
  61. <if test="transferDate != null">transfer_date,</if>
  62. <if test="transferTake != null">transfer_take,</if>
  63. <if test="militaryRank1 != null">military_rank1,</if>
  64. <if test="militaryRank2 != null">military_rank2,</if>
  65. <if test="post1 != null">post1,</if>
  66. <if test="post2 != null">post2,</if>
  67. <if test="unit1 != null">unit1,</if>
  68. <if test="unit2 != null">unit2,</if>
  69. <if test="aduty != null">aduty,</if>
  70. <if test="commandNumber != null">command_number,</if>
  71. <if test="reason != null">reason,</if>
  72. <if test="remark != null">remark,</if>
  73. <if test="field1 != null">field1,</if>
  74. <if test="createtime != null">createtime,</if>
  75. <if test="updatetime != null">updatetime,</if>
  76. <if test="cName != null">c_name,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="peopleId != null">#{peopleId},</if>
  80. <if test="transferId != null">#{transferId},</if>
  81. <if test="transferDate != null">#{transferDate},</if>
  82. <if test="transferTake != null">#{transferTake},</if>
  83. <if test="militaryRank1 != null">#{militaryRank1},</if>
  84. <if test="militaryRank2 != null">#{militaryRank2},</if>
  85. <if test="post1 != null">#{post1},</if>
  86. <if test="post2 != null">#{post2},</if>
  87. <if test="unit1 != null">#{unit1},</if>
  88. <if test="unit2 != null">#{unit2},</if>
  89. <if test="aduty != null">#{aduty},</if>
  90. <if test="commandNumber != null">#{commandNumber},</if>
  91. <if test="reason != null">#{reason},</if>
  92. <if test="remark != null">#{remark},</if>
  93. <if test="field1 != null">#{field1},</if>
  94. <if test="createtime != null">#{createtime},</if>
  95. <if test="updatetime != null">#{updatetime},</if>
  96. <if test="cName != null">#{cName},</if>
  97. </trim>
  98. </insert>
  99. <update id="updateBdglPeopleTransfer" parameterType="BdglPeopleTransfer">
  100. update bdgl_people_transfer
  101. <trim prefix="SET" suffixOverrides=",">
  102. <if test="peopleId != null">people_id = #{peopleId},</if>
  103. <if test="transferId != null">transfer_id = #{transferId},</if>
  104. <if test="transferDate != null">transfer_date = #{transferDate},</if>
  105. <if test="transferTake != null">transfer_take = #{transferTake},</if>
  106. <if test="militaryRank1 != null">military_rank1 = #{militaryRank1},</if>
  107. <if test="militaryRank2 != null">military_rank2 = #{militaryRank2},</if>
  108. <if test="post1 != null">post1 = #{post1},</if>
  109. <if test="post2 != null">post2 = #{post2},</if>
  110. <if test="unit1 != null">unit1 = #{unit1},</if>
  111. <if test="unit2 != null">unit2 = #{unit2},</if>
  112. <if test="aduty != null">aduty = #{aduty},</if>
  113. <if test="commandNumber != null">command_number = #{commandNumber},</if>
  114. <if test="reason != null">reason = #{reason},</if>
  115. <if test="remark != null">remark = #{remark},</if>
  116. <if test="field1 != null">field1 = #{field1},</if>
  117. <if test="createtime != null">createtime = #{createtime},</if>
  118. <if test="updatetime != null">updatetime = #{updatetime},</if>
  119. <if test="cName != null">c_name = #{cName},</if>
  120. </trim>
  121. where id = #{id}
  122. </update>
  123. <delete id="deleteBdglPeopleTransferById" parameterType="Integer">
  124. delete from bdgl_people_transfer where id = #{id}
  125. </delete>
  126. <delete id="deleteBdglPeopleTransferByIds" parameterType="String">
  127. delete from bdgl_people_transfer where id in
  128. <foreach item="id" collection="array" open="(" separator="," close=")">
  129. #{id}
  130. </foreach>
  131. </delete>
  132. </mapper>