BillnoDelMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.ruoyi.warehouseBusiness.mapper.BillnoDelMapper">
  6. <resultMap type="BillnoDel" id="BillnoDelResult">
  7. <result property="id" column="id"/>
  8. <result property="billType" column="bill_type"/>
  9. <result property="billNo" column="bill_no"/>
  10. <result property="remarks" column="remarks"/>
  11. </resultMap>
  12. <sql id="selectBillnoDelVo">
  13. select id, bill_type, bill_no, remarks from billno_del
  14. </sql>
  15. <select id="selectBillnoDelList" parameterType="BillnoDel" resultMap="BillnoDelResult">
  16. <include refid="selectBillnoDelVo"/>
  17. <where>
  18. <if test="billType != null and billType != ''">and bill_type = #{billType}</if>
  19. <if test="billNo != null and billNo != ''">and bill_no = #{billNo}</if>
  20. <if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
  21. </where>
  22. </select>
  23. <select id="selectBillnoDelById" parameterType="Long" resultMap="BillnoDelResult">
  24. <include refid="selectBillnoDelVo"/>
  25. where id = #{id}
  26. </select>
  27. <select id="selectBillnoDelBillNo" parameterType="BillnoDel" resultMap="BillnoDelResult">
  28. select id, bill_type, bill_no from billno_del
  29. <where>
  30. <if test="billType != null and billType != ''">and bill_type = #{billType}</if>
  31. <if test="billNo != null and billNo != ''">and bill_no = #{billNo}</if>
  32. <if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
  33. </where>
  34. </select>
  35. <insert id="insertBillnoDel" parameterType="BillnoDel" useGeneratedKeys="true" keyProperty="id">
  36. insert into billno_del
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="billType != null">bill_type,</if>
  39. <if test="billNo != null">bill_no,</if>
  40. <if test="remarks != null">remarks,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="billType != null">#{billType},</if>
  44. <if test="billNo != null">#{billNo},</if>
  45. <if test="remarks != null">#{remarks},</if>
  46. </trim>
  47. </insert>
  48. <update id="updateBillnoDel" parameterType="BillnoDel">
  49. update billno_del
  50. <trim prefix="SET" suffixOverrides=",">
  51. <if test="billType != null">bill_type = #{billType},</if>
  52. <if test="billNo != null">bill_no = #{billNo},</if>
  53. <if test="remarks != null">remarks = #{remarks},</if>
  54. </trim>
  55. where id = #{id}
  56. </update>
  57. <delete id="deleteBillnoDelById" parameterType="Long">
  58. delete from billno_del where id = #{id}
  59. </delete>
  60. <delete id="deleteBillnoDelByIds" parameterType="String">
  61. delete from billno_del where id in
  62. <foreach item="id" collection="array" open="(" separator="," close=")">
  63. #{id}
  64. </foreach>
  65. </delete>
  66. </mapper>