<?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.panzhihua.service_grid.dao.EventResourceMapper">
|
|
<resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.EventResourceDO">
|
<result property="id" column="id"/>
|
<result property="classification" column="classification"/>
|
<result property="refId" column="ref_id"/>
|
<result property="type" column="type"/>
|
<result property="resourceName" column="resource_name"/>
|
<result property="resourceSize" column="resource_size"/>
|
<result property="resourceTime" column="resource_time"/>
|
<result property="url" column="url"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createAt" column="create_at"/>
|
</resultMap>
|
|
<sql id="columns">
|
<![CDATA[
|
id,classification,ref_id,type,resource_name,resource_size,resource_time, url,create_by,create_at
|
]]>
|
</sql>
|
|
|
<select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventResourceVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PageEventResourceDTO">
|
SELECT <include refid="columns" />
|
FROM event_resource
|
<where>
|
<if test="pageEventResourceDTO.classification!=null">
|
AND classification = #{pageEventResourceDTO.classification}
|
</if>
|
<if test="pageEventResourceDTO.id!=null">
|
AND id = #{pageEventResourceDTO.id}
|
</if>
|
<if test="pageEventResourceDTO.refId!=null">
|
AND ref_id = #{pageEventResourceDTO.refId}
|
</if>
|
<if test="pageEventResourceDTO.type!=null">
|
AND type = #{pageEventResourceDTO.type}
|
</if>
|
<if test="pageEventResourceDTO.resourceName!=null">
|
AND resource_name = #{pageEventResourceDTO.resourceName}
|
</if>
|
<if test="pageEventResourceDTO.resourceSize!=null">
|
AND resource_size = #{pageEventResourceDTO.resourceSize}
|
</if>
|
<if test="pageEventResourceDTO.url!=null">
|
AND url = #{pageEventResourceDTO.url}
|
</if>
|
<if test="pageEventResourceDTO.createBy!=null">
|
AND create_by = #{pageEventResourceDTO.createBy}
|
</if>
|
<if test="pageEventResourceDTO.createAtBegin!=null">
|
AND create_at >= #{pageEventResourceDTO.createAtBegin}
|
</if>
|
<if test="pageEventResourceDTO.createAtEnd!=null">
|
AND create_at <= #{pageEventResourceDTO.createAtEnd}
|
</if>
|
</where>
|
<if test="pageEventResourceDTO.sortColumns!=null">
|
ORDER BY ${pageEventResourceDTO.sortColumns} ${pageEventResourceDTO.sortType}
|
</if>
|
</select>
|
|
<select id="findListByRefId" resultType="com.panzhihua.common.model.vos.grid.EventResourceVO">
|
SELECT url,resource_time FROM event_resource
|
where ref_id = #{id} and classification = #{classification} and type = #{type} order by id desc
|
</select>
|
</mapper>
|