FmsLandHouseMapper.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.yunfeiyun.agmp.fms.mapper.FmsLandHouseMapper">
  6. <sql id="selectFmsLandHouseVo">
  7. select landhouseId, landId, warehouseId from FmsLandHouse
  8. </sql>
  9. <select id="selectFmsLandHouseList" parameterType="FmsLandHouse" resultType="FmsLandHouse">
  10. <include refid="selectFmsLandHouseVo"/>
  11. <where>
  12. <if test="landId != null and landId != ''"> and landId = #{landId}</if>
  13. <if test="warehouseId != null and warehouseId != ''"> and warehouseId = #{warehouseId}</if>
  14. <if test="tid != null and tid != '-1'">and tid = #{tid}</if>
  15. </where>
  16. </select>
  17. <select id="selectFmsLandHouseByLandhouseId" parameterType="String" resultType="FmsLandHouse">
  18. <include refid="selectFmsLandHouseVo"/>
  19. where landhouseId = #{landhouseId}
  20. <if test="tid != null and tid !='' and tid != '-1'">
  21. and tid = #{tid}
  22. </if>
  23. </select>
  24. <select id="selectFmsLandHouseByWarehouseId" parameterType="String" resultType="FmsLandHouse">
  25. <include refid="selectFmsLandHouseVo"/>
  26. where tid = #{tid} and warehouseId in
  27. <foreach item="warehouseId" collection="array" open="(" separator="," close=")">
  28. #{warehouseId}
  29. </foreach>
  30. </select>
  31. <insert id="insertFmsLandHouse" parameterType="FmsLandHouse">
  32. insert into FmsLandHouse
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="landhouseId != null">landhouseId,</if>
  35. <if test="landId != null">landId,</if>
  36. <if test="warehouseId != null">warehouseId,</if>
  37. tid
  38. </trim>
  39. <trim prefix="values (" suffix=")" suffixOverrides=",">
  40. <if test="landhouseId != null">#{landhouseId},</if>
  41. <if test="landId != null">#{landId},</if>
  42. <if test="warehouseId != null">#{warehouseId},</if>
  43. #{tid}
  44. </trim>
  45. </insert>
  46. <insert id="insertBatchFmsLandHouse" parameterType="FmsLandHouse">
  47. insert into FmsLandHouse (landhouseId, landId, warehouseId, tid)
  48. values
  49. <foreach collection="list" item="item" index="index" separator=",">
  50. (#{item.landhouseId}, #{item.landId}, #{item.warehouseId}, #{item.tid})
  51. </foreach>
  52. </insert>
  53. <update id="updateFmsLandHouse" parameterType="FmsLandHouse">
  54. update FmsLandHouse
  55. <trim prefix="SET" suffixOverrides=",">
  56. <if test="landId != null">landId = #{landId},</if>
  57. <if test="warehouseId != null">warehouseId = #{warehouseId},</if>
  58. </trim>
  59. where landhouseId = #{landhouseId}
  60. <if test="tid != null and tid !='' and tid != '-1'">
  61. and tid = #{tid}
  62. </if>
  63. </update>
  64. <delete id="deleteFmsLandHouseByLandhouseId" parameterType="String">
  65. delete from FmsLandHouse where landhouseId = #{landhouseId}
  66. <if test="tid != null and tid !='' and tid != '-1'">
  67. and tid = #{tid}
  68. </if>
  69. </delete>
  70. <delete id="deleteFmsLandHouseByLandhouseIds" parameterType="String">
  71. delete from FmsLandHouse where tid = #{tid} and landhouseId in
  72. <foreach item="landhouseId" collection="array" open="(" separator="," close=")">
  73. #{landhouseId}
  74. </foreach>
  75. </delete>
  76. <delete id="deleteFmsLandHouseByWarehouseId" parameterType="String">
  77. delete from FmsLandHouse where warehouseId = #{warehouseId} and tid = #{tid}
  78. </delete>
  79. <delete id="deleteBatchFmsLandHouseByWarehouseIds">
  80. delete from FmsLandHouse where tid = #{tid} and warehouseId in
  81. <foreach item="warehouseId" collection="array" open="(" separator="," close=")">
  82. #{warehouseId}
  83. </foreach>
  84. </delete>
  85. </mapper>