123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.huaxu.dao.SceneImageMapper">
- <resultMap type="SceneImageEntity" id="SceneImageResult">
- <result property="id" column="id"/>
- <result property="imageType" column="image_type"/>
- <result property="imagePath" column="image_path"/>
- <result property="sceneId" column="scene_id"/>
- <result property="status" column="status"/>
- <result property="dateCreate" column="date_create"/>
- <result property="createBy" column="create_by"/>
- <result property="dateUpdate" column="date_update"/>
- <result property="updateBy" column="update_by"/>
- </resultMap>
- <!-- 实体栏位 -->
- <sql id="sceneImageColumns">
- a.id as "id" ,
- a.image_type as "imageType" ,
- a.image_path as "imagePath" ,
- a.scene_id as "sceneId" ,
- a.status as "status" ,
- a.date_create as "dateCreate" ,
- a.create_by as "createBy" ,
- a.date_update as "dateUpdate" ,
- a.update_by as "updateBy"
- </sql>
- <!-- 根据主键获取实体 -->
- <select id="findSceneImageById" resultType="com.huaxu.entity.SceneImageEntity">
- SELECT
- <include refid="sceneImageColumns"/>
- FROM sms_scene_image a
- WHERE a.id = #{id}
- </select>
- <!-- 根据获取实体List -->
- <select id="findList" resultType="com.huaxu.entity.SceneImageEntity">
- SELECT
- <include refid="sceneImageColumns"/>
- FROM sms_scene_image a
- <where>
- <if test="imageType != null ">and a.image_type = #{imageType}</if>
- <if test="imagePath != null and imagePath != ''">and a.image_path = #{imagePath}</if>
- <if test="sceneId != null ">and a.scene_id = #{sceneId}</if>
- <if test="dateUpdate != null ">and a.date_update = #{dateUpdate}</if>
- </where>
- </select>
- <!-- 根据获取实体 page -->
- <select id="findPage" resultType="com.huaxu.entity.SceneImageEntity">
- SELECT
- <include refid="sceneImageColumns"/>
- FROM sms_scene_image a
- <where>
- <if test="sceneImage.imageType != null ">and a.image_type = #{sceneImage.imageType}</if>
- <if test="sceneImage.imagePath != null and sceneImage.imagePath != ''">and a.image_path =
- #{sceneImage.imagePath}
- </if>
- <if test="sceneImage.sceneId != null ">and a.scene_id = #{sceneImage.sceneId}</if>
- <if test="sceneImage.dateUpdate != null ">and a.date_update = #{sceneImage.dateUpdate}</if>
- </where>
- </select>
- </mapper>
|