SceneImageMapper.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.huaxu.dao.SceneImageMapper">
  6. <resultMap type="SceneImageEntity" id="SceneImageResult">
  7. <result property="id" column="id"/>
  8. <result property="imageType" column="image_type"/>
  9. <result property="imagePath" column="image_path"/>
  10. <result property="sceneId" column="scene_id"/>
  11. <result property="status" column="status"/>
  12. <result property="dateCreate" column="date_create"/>
  13. <result property="createBy" column="create_by"/>
  14. <result property="dateUpdate" column="date_update"/>
  15. <result property="updateBy" column="update_by"/>
  16. </resultMap>
  17. <!-- 实体栏位 -->
  18. <sql id="sceneImageColumns">
  19. a.id as "id" ,
  20. a.image_type as "imageType" ,
  21. a.image_path as "imagePath" ,
  22. a.scene_id as "sceneId" ,
  23. a.status as "status" ,
  24. a.date_create as "dateCreate" ,
  25. a.create_by as "createBy" ,
  26. a.date_update as "dateUpdate" ,
  27. a.update_by as "updateBy"
  28. </sql>
  29. <!-- 根据主键获取实体 -->
  30. <select id="findSceneImageById" resultType="com.huaxu.entity.SceneImageEntity">
  31. SELECT
  32. <include refid="sceneImageColumns"/>
  33. FROM sms_scene_image a
  34. WHERE a.id = #{id}
  35. </select>
  36. <!-- 根据获取实体List -->
  37. <select id="findList" resultType="com.huaxu.entity.SceneImageEntity">
  38. SELECT
  39. <include refid="sceneImageColumns"/>
  40. FROM sms_scene_image a
  41. <where>
  42. <if test="imageType != null ">and a.image_type = #{imageType}</if>
  43. <if test="imagePath != null and imagePath != ''">and a.image_path = #{imagePath}</if>
  44. <if test="sceneId != null ">and a.scene_id = #{sceneId}</if>
  45. <if test="dateUpdate != null ">and a.date_update = #{dateUpdate}</if>
  46. </where>
  47. </select>
  48. <!-- 根据获取实体 page -->
  49. <select id="findPage" resultType="com.huaxu.entity.SceneImageEntity">
  50. SELECT
  51. <include refid="sceneImageColumns"/>
  52. FROM sms_scene_image a
  53. <where>
  54. <if test="sceneImage.imageType != null ">and a.image_type = #{sceneImage.imageType}</if>
  55. <if test="sceneImage.imagePath != null and sceneImage.imagePath != ''">and a.image_path =
  56. #{sceneImage.imagePath}
  57. </if>
  58. <if test="sceneImage.sceneId != null ">and a.scene_id = #{sceneImage.sceneId}</if>
  59. <if test="sceneImage.dateUpdate != null ">and a.date_update = #{sceneImage.dateUpdate}</if>
  60. </where>
  61. </select>
  62. </mapper>