| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- <?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="cn.com.goldenwater.dcproj.dao.GwComFileDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.GwComFile" id="gwComFileResultMap">
- <result property="id" column="ID"/>
- <result property="fileTitle" column="FILE_TITLE"/>
- <result property="keyWord" column="KEY_WORD"/>
- <result property="fileType" column="FILE_TYPE"/>
- <result property="abs" column="ABS"/>
- <result property="fileName" column="FILE_NAME"/>
- <result property="fileSize" column="FILE_SIZE"/>
- <result property="fileExt" column="FILE_EXT"/>
- <result property="filePath" column="FILE_PATH"/>
- <result property="thumbnailUrl" column="THUMBNAIL_URL"/>
- <result property="bizType" column="BIZ_TYPE"/>
- <result property="bizId" column="BIZ_ID"/>
- <result property="longitude" column="LONGITUDE"/>
- <result property="latitude" column="LATITUDE"/>
- <result property="createBy" column="CREATE_BY"/>
- <result property="createDate" column="CREATE_DATE"/>
- <result property="updateBy" column="UPDATE_BY"/>
- <result property="updateDate" column="UPDATE_DATE"/>
- <result property="downNum" column="DOWN_NUM"/>
- <result property="sn" column="SN"/>
- <result property="topValue" column="TOP"/>
- <result property="topDate" column="TOP_DATE"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- FILE_TITLE,
- KEY_WORD,
- FILE_TYPE,
- ABS,
- FILE_NAME,
- FILE_SIZE,
- FILE_EXT,
- FILE_PATH,
- THUMBNAIL_URL,
- BIZ_TYPE,
- BIZ_ID,
- LONGITUDE,
- LATITUDE,
- CREATE_BY,
- CREATE_DATE,
- UPDATE_BY,
- UPDATE_DATE,
- DOWN_NUM,
- SN,
- TOP,
- TOP_DATE
- </sql>
- <sql id="entity_properties">
- #{id},
- #{fileTitle},
- #{keyWord},
- #{fileType},
- #{abs},
- #{fileName},
- #{fileSize},
- #{fileExt},
- #{filePath},
- #{thumbnailUrl},
- #{bizType},
- #{bizId},
- #{longitude},
- #{latitude},
- #{createBy},
- #{createDate},
- #{updateBy},
- #{updateDate},
- #{downNum},
- #{sn},
- #{topValue},
- #{topDate}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="fileTitle != null and fileTitle != ''">and FILE_TITLE = #{fileTitle}</if>
- <if test="keyWord != null and keyWord != ''">and KEY_WORD = #{keyWord}</if>
- <if test="fileType != null and fileType != ''">and FILE_TYPE = #{fileType}</if>
- <if test="abs != null and abs != ''">and ABS = #{abs}</if>
- <if test="fileName != null and fileName != ''">and FILE_NAME like '${fileName}%'</if>
- <if test="fileSize != null and fileSize != ''">and FILE_SIZE = #{fileSize}</if>
- <if test="fileExt != null and fileExt != ''">and FILE_EXT = #{fileExt}</if>
- <if test="filePath != null and filePath != ''">and FILE_PATH = #{filePath}</if>
- <if test="thumbnailUrl != null and thumbnailUrl != ''">and THUMBNAIL_URL = #{thumbnailUrl}</if>
- <if test="bizType != null and bizType != ''">and BIZ_TYPE like '${bizType}%'</if>
- <if test="bizId != null and bizId != ''">and BIZ_ID = #{bizId}</if>
- <if test="longitude != null and longitude != ''">and LONGITUDE = #{longitude}</if>
- <if test="latitude != null and latitude != ''">and LATITUDE = #{latitude}</if>
- <if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
- <if test="createDate != null">and CREATE_DATE = #{createDate}</if>
- <if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
- <if test="updateDate != null">and UPDATE_DATE = #{updateDate}</if>
- <if test="downNum != null and downNum != ''">and DOWN_NUM = #{downNum}</if>
- <if test="sn != null and sn != ''">and SN = #{sn}</if>
- <if test="topValue != null and top != ''">and TOP = #{topValue}</if>
- <if test="topDate != null">and TOP_DATE = #{topDate}</if>
- </trim>
- </sql>
- <select id="get" resultMap="gwComFileResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from gw_com_file where ID = #{id}
- </select>
- <select id="getBy" resultMap="gwComFileResultMap">
- select
- <include refid="table_columns"/>
- from gw_com_file
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="gwComFileResultMap">
- select
- <include refid="table_columns"/>
- from gw_com_file
- ORDER BY CREATE_DATE
- </select>
- <select id="findList" resultMap="gwComFileResultMap">
- select
- <include refid="table_columns"/>
- from gw_com_file
- <include refid="page_where"/>
- ORDER BY CREATE_DATE
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from gw_com_file
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.GwComFile">
- insert into gw_com_file(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from gw_com_file where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.GwComFile">
- delete from gw_com_file
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update gw_com_file set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.GwComFile">
- update gw_com_file
- <trim prefix="set" suffixOverrides=",">
- <if test="fileTitle != null and fileTitle != ''">FILE_TITLE = #{fileTitle},</if>
- <if test="keyWord != null and keyWord != ''">KEY_WORD = #{keyWord},</if>
- <if test="fileType != null and fileType != ''">FILE_TYPE = #{fileType},</if>
- <if test="abs != null and abs != ''">ABS = #{abs},</if>
- <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
- <if test="fileSize != null and fileSize != ''">FILE_SIZE = #{fileSize},</if>
- <if test="fileExt != null and fileExt != ''">FILE_EXT = #{fileExt},</if>
- <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
- <if test="thumbnailUrl != null and thumbnailUrl != ''">THUMBNAIL_URL = #{thumbnailUrl},</if>
- <if test="bizType != null and bizType != ''">BIZ_TYPE = #{bizType},</if>
- <if test="bizId != null and bizId != ''">BIZ_ID = #{bizId},</if>
- <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
- <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
- <if test="createBy != null and createBy != ''">CREATE_BY = #{createBy},</if>
- <if test="createDate != null">CREATE_DATE = #{createDate},</if>
- <if test="updateBy != null and updateBy != ''">UPDATE_BY = #{updateBy},</if>
- <if test="updateDate != null">UPDATE_DATE = #{updateDate},</if>
- <if test="downNum != null and downNum != ''">DOWN_NUM = #{downNum},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="topValue != null and topValue != ''">TOP = #{topValue},</if>
- <if test="topDate != null">TOP_DATE = #{topDate}</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.GwComFile">
- update gw_com_file
- <trim prefix="set" suffixOverrides=",">
- <if test="fileTitle != null and fileTitle != ''">FILE_TITLE = #{fileTitle},</if>
- <if test="keyWord != null and keyWord != ''">KEY_WORD = #{keyWord},</if>
- <if test="fileType != null and fileType != ''">FILE_TYPE = #{fileType},</if>
- <if test="abs != null and abs != ''">ABS = #{abs},</if>
- <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
- <if test="fileSize != null and fileSize != ''">FILE_SIZE = #{fileSize},</if>
- <if test="fileExt != null and fileExt != ''">FILE_EXT = #{fileExt},</if>
- <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
- <if test="thumbnailUrl != null and thumbnailUrl != ''">THUMBNAIL_URL = #{thumbnailUrl},</if>
- <if test="bizType != null and bizType != ''">BIZ_TYPE = #{bizType},</if>
- <if test="bizId != null and bizId != ''">BIZ_ID = #{bizId},</if>
- <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
- <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
- <if test="createBy != null and createBy != ''">CREATE_BY = #{createBy},</if>
- <if test="createDate != null">CREATE_DATE = #{createDate},</if>
- <if test="updateBy != null and updateBy != ''">UPDATE_BY = #{updateBy},</if>
- <if test="updateDate != null">UPDATE_DATE = #{updateDate},</if>
- <if test="downNum != null and downNum != ''">DOWN_NUM = #{downNum},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="topValue != null and topValue != ''">TOP = #{topValue},</if>
- <if test="topDate != null">TOP_DATE = #{topDate}</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <select id="findLongFileExt" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select * from gw_com_file e where length(e.file_ext)>12
- </select>
- <!-- 其他自定义SQL -->
- <select id="findFileByBiz" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- SELECT
- <include refid="table_columns"/>
- from gw_com_file WHERE BIZ_ID = #{bizId} ORDER BY SN,CREATE_DATE
- </select>
- <select id="countByPblmId" parameterType="String" resultType="java.lang.Integer">
- SELECT
- COUNT(*)
- FROM GW_COM_FILE
- WHERE BIZ_ID = #{bizId}
- </select>
- <select id="listByCon" resultMap="gwComFileResultMap"
- parameterType="cn.com.goldenwater.dcproj.param.GwComFileParam">
- SELECT
- <include refid="table_columns"/>
- FROM gw_com_file
- <where>
- <if test="bizType != null and bizType != '' and bizType != 'signature' ">
- and BIZ_TYPE = #{bizType}
- </if>
- <if test="fileName != null and fileName != '' ">
- AND FILE_NAME LIKE CONCAT('%', CONCAT(#{fileName}, '%'))
- </if>
- <if test="fileIds != null and fileIds.size() > 0">
- and BIZ_ID IN
- <foreach collection="fileIds" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY TOP_DATE is null, TOP_DATE, CREATE_DATE DESC
- </select>
- <update id="updateBizId">
- UPDATE gw_com_file set BIZ_ID = #{bizId} where ID = #{id}
- </update>
- <update id="updateTop">
- UPDATE
- gw_com_file
- set
- TOP = #{topValue},
- TOP_DATE = #{topDate}
- where
- ID = #{id}
- </update>
- <!--根据条件获取最新n条近期面貌数据-->
- <select id="findImgPage" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,B.RSVR_NM OBJ_NAME from gw_com_file A left join bis_insp_rsvr_rgstr B ON A.BIZ_ID=B.rgstr_id
- where A.biz_id is not null
- and FILE_EXT IN ('jpg','JPG','PNG','png')
- AND B.AD_CODE like CONCAT(#{adCode}, '%')
- AND B.RSVR_NM IS NOT NULL
- order by A.create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条近期面貌数据-->
- <select id="getImgByBizId" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*
- from gw_com_file A
- where FILE_EXT IN ('jpg','JPG','PNG','png')
- AND A.BIZ_ID = #{bizId}
- order by A.create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条近期面貌数据-->
- <select id="getTopNFace" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,B.RSVR_NM OBJ_NAME from gw_com_file A left join bis_insp_rsvr_rgstr B ON A.BIZ_ID=B.rgstr_id
- where A.biz_id is not null
- and FILE_EXT IN ('jpg','JPG','PNG','png')
- AND B.AD_CODE like CONCAT(#{adCode}, '%')
- AND B.RSVR_NM IS NOT NULL
- order by A.create_date desc
- limit ${n}
- </select>
- <!--根据条件获取水闸最新n条近期面貌数据-->
- <select id="getTopHnNFace" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,B.gate_name OBJ_NAME from gw_com_file A left join ATT_WAGA_RGSTR B ON A.BIZ_ID=B.obj_id
- where A.biz_id is not null
- and FILE_EXT IN ('jpg','JPG','PNG','png')
- AND B.AD_CODE like CONCAT(#{adCode}, '%')
- AND B.gate_name IS NOT NULL
- order by A.create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条近期问题-->
- <select id="getTopNPblm" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,B.OBJ_NAME from gw_com_file A LEFT JOIN bis_insp_pblm B ON A.BIZ_ID=B.pblm_id
- where A.biz_id is not null
- and A.FILE_EXT IN ('jpg','JPG','PNG','png')
- AND B.obj_ad_code like CONCAT(#{currentAdCode}, '%')
- AND B.OBJ_NAME IS NOT NULL
- <if test="pType != null and pType != '' ">
- and B.obj_type=#{pType}
- </if>
- <if test="adCode != null and adCode != '' ">
- and B.obj_ad_code like CONCAT(#{adCode}, '%')
- </if>
- order by create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条近期问题视频-->
- <select id="getTopNPblmVido" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select * from gw_com_file A LEFT JOIN bis_insp_pblm B ON A.biz_id=B.pblm_id
- where A.biz_id is not null
- and A.FILE_EXT IN ('mp4','MP4','3gp','m4a','MP3','mp3','avi')
- AND B.OBJ_NAME IS NOT NULL
- AND B.obj_ad_code like CONCAT(#{adCode}, '%')
- order by create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条稽察问题数据-->
- <select id="getTopTacPlam" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,C.OJB_NM OBJ_NAME from gw_com_file A LEFT JOIN TAC_PBLM_INFO B ON A.biz_id=B.ID
- left join TAC_INSP_YEAR_BATCH_OBJ C on B.OBJ_ID=C.ID
- where A.biz_id is not null
- and FILE_EXT IN ('jpg','JPG','PNG','png')
- AND B.PROVINCE =#{province}
- AND C.OJB_NM IS NOT NULL
- order by A.create_date desc
- limit ${n}
- </select>
- <!--根据条件获取最新n条稽察问题数据-->
- <select id="getTopTacPlamVideo" resultType="cn.com.goldenwater.dcproj.model.GwComFile">
- select A.*,C.OJB_NM OBJ_NAME from gw_com_file A LEFT JOIN TAC_PBLM_INFO B ON A.biz_id=B.ID
- left join TAC_INSP_YEAR_BATCH_OBJ C on B.OBJ_ID=C.ID
- where A.biz_id is not null
- AND B.PROVINCE =#{province}
- and A.FILE_EXT IN ('mp4','MP4','3gp','m4a','MP3','mp3','avi')
- AND C.OJB_NM IS NOT NULL
- order by create_date desc
- limit ${n}
- </select>
- </mapper>
|