猫妈狗爸伴宠师小程序后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
6.0 KiB

1 month ago
  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.model.mapper.AppPetsBreadMapper">
  6. <resultMap type="AppPetsBread" id="AppPetsBreadResult">
  7. <result property="petBreadId" column="pet_bread_id" />
  8. <result property="petSpeciesId" column="pet_species_id" />
  9. <result property="petsBreadName" column="pets_bread_name" />
  10. <result property="petHealthidId" column="pet_healthid_id" />
  11. <result property="petId" column="pet_id" />
  12. <result property="petsHealthidCertificate" column="pets_healthid_certificate" />
  13. <result property="petsHealthidDeworming" column="pets_healthid_deworming" />
  14. <result property="petsHealthidInfo" column="pets_healthid_info" />
  15. <result property="petsHealthidSterilization" column="pets_healthid_sterilization" />
  16. <result property="petsHealthidVaccine" column="pets_healthid_vaccine" />
  17. </resultMap>
  18. <sql id="selectAppPetsBreadVo">
  19. select pet_bread_id, pet_species_id, pets_bread_name, pet_healthid_id, pet_id, pets_healthid_certificate, pets_healthid_deworming, pets_healthid_info, pets_healthid_sterilization, pets_healthid_vaccine from app_pets_bread
  20. </sql>
  21. <select id="selectAppPetsBreadList" parameterType="AppPetsBread" resultMap="AppPetsBreadResult">
  22. <include refid="selectAppPetsBreadVo"/>
  23. <where>
  24. <if test="petSpeciesId != null "> and pet_species_id = #{petSpeciesId}</if>
  25. <if test="petsBreadName != null and petsBreadName != ''"> and pets_bread_name like concat('%', #{petsBreadName}, '%')</if>
  26. <if test="petHealthidId != null "> and pet_healthid_id = #{petHealthidId}</if>
  27. <if test="petId != null "> and pet_id = #{petId}</if>
  28. <if test="petsHealthidCertificate != null "> and pets_healthid_certificate = #{petsHealthidCertificate}</if>
  29. <if test="petsHealthidDeworming != null "> and pets_healthid_deworming = #{petsHealthidDeworming}</if>
  30. <if test="petsHealthidInfo != null and petsHealthidInfo != ''"> and pets_healthid_info = #{petsHealthidInfo}</if>
  31. <if test="petsHealthidSterilization != null "> and pets_healthid_sterilization = #{petsHealthidSterilization}</if>
  32. <if test="petsHealthidVaccine != null "> and pets_healthid_vaccine = #{petsHealthidVaccine}</if>
  33. </where>
  34. </select>
  35. <select id="selectAppPetsBreadByPetBreadId" parameterType="Long" resultMap="AppPetsBreadResult">
  36. <include refid="selectAppPetsBreadVo"/>
  37. where pet_bread_id = #{petBreadId}
  38. </select>
  39. <select id="getAppPetsBreadList" resultType="com.ruoyi.model.domain.AppPetsBread">
  40. <include refid="selectAppPetsBreadVo"/>
  41. </select>
  42. <insert id="insertAppPetsBread" parameterType="AppPetsBread">
  43. insert into app_pets_bread
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="petBreadId != null">pet_bread_id,</if>
  46. <if test="petSpeciesId != null">pet_species_id,</if>
  47. <if test="petsBreadName != null">pets_bread_name,</if>
  48. <if test="petHealthidId != null">pet_healthid_id,</if>
  49. <if test="petId != null">pet_id,</if>
  50. <if test="petsHealthidCertificate != null">pets_healthid_certificate,</if>
  51. <if test="petsHealthidDeworming != null">pets_healthid_deworming,</if>
  52. <if test="petsHealthidInfo != null">pets_healthid_info,</if>
  53. <if test="petsHealthidSterilization != null">pets_healthid_sterilization,</if>
  54. <if test="petsHealthidVaccine != null">pets_healthid_vaccine,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="petBreadId != null">#{petBreadId},</if>
  58. <if test="petSpeciesId != null">#{petSpeciesId},</if>
  59. <if test="petsBreadName != null">#{petsBreadName},</if>
  60. <if test="petHealthidId != null">#{petHealthidId},</if>
  61. <if test="petId != null">#{petId},</if>
  62. <if test="petsHealthidCertificate != null">#{petsHealthidCertificate},</if>
  63. <if test="petsHealthidDeworming != null">#{petsHealthidDeworming},</if>
  64. <if test="petsHealthidInfo != null">#{petsHealthidInfo},</if>
  65. <if test="petsHealthidSterilization != null">#{petsHealthidSterilization},</if>
  66. <if test="petsHealthidVaccine != null">#{petsHealthidVaccine},</if>
  67. </trim>
  68. </insert>
  69. <update id="updateAppPetsBread" parameterType="AppPetsBread">
  70. update app_pets_bread
  71. <trim prefix="SET" suffixOverrides=",">
  72. <if test="petSpeciesId != null">pet_species_id = #{petSpeciesId},</if>
  73. <if test="petsBreadName != null">pets_bread_name = #{petsBreadName},</if>
  74. <if test="petHealthidId != null">pet_healthid_id = #{petHealthidId},</if>
  75. <if test="petId != null">pet_id = #{petId},</if>
  76. <if test="petsHealthidCertificate != null">pets_healthid_certificate = #{petsHealthidCertificate},</if>
  77. <if test="petsHealthidDeworming != null">pets_healthid_deworming = #{petsHealthidDeworming},</if>
  78. <if test="petsHealthidInfo != null">pets_healthid_info = #{petsHealthidInfo},</if>
  79. <if test="petsHealthidSterilization != null">pets_healthid_sterilization = #{petsHealthidSterilization},</if>
  80. <if test="petsHealthidVaccine != null">pets_healthid_vaccine = #{petsHealthidVaccine},</if>
  81. </trim>
  82. where pet_bread_id = #{petBreadId}
  83. </update>
  84. <delete id="deleteAppPetsBreadByPetBreadId" parameterType="Long">
  85. delete from app_pets_bread where pet_bread_id = #{petBreadId}
  86. </delete>
  87. <delete id="deleteAppPetsBreadByPetBreadIds" parameterType="String">
  88. delete from app_pets_bread where pet_bread_id in
  89. <foreach item="petBreadId" collection="array" open="(" separator="," close=")">
  90. #{petBreadId}
  91. </foreach>
  92. </delete>
  93. </mapper>