xkrs_ms/ruoyi-system/src/main/resources/mapper/system/AorestCoverageMapper.xml

139 lines
5.2 KiB
XML

<?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.ruoyi.system.mapper_yada.AorestCoverageMapper">
<resultMap id="RM_AorestCoverage" type="com.ruoyi.system.domain_yada.AorestCoverageVO">
<result property="id" column="id"/>
<result property="particularYear" column="particular_year"/>
<result property="region" column="region"/>
<result property="regionEn" column="region_en"/>
<result property="protectedLands" column="protected_lands"/>
<result property="nonProtectedLands" column="non_protected_lands"/>
<result property="mountain" column="mountain"/>
<result property="nonMountain" column="non_mountain"/>
<result property="createBy" column="created_by"/>
<result property="createTime" column="created_time"/>
</resultMap>
<sql id="columns">
<![CDATA[
id,particular_year,region,region_en,protected_lands,non_protected_lands,mountain,non_mountain,created_by,created_time
]]>
</sql>
<select id="selectAorestCoverage" resultMap="RM_AorestCoverage">
SELECT <include refid="columns"/> FROM forest_coverage;
</select>
<delete id="DelAorestCoverage">
DELETE FROM forest_coverage
WHERE ID=#{id}
</delete>
<insert id="IntoAorestCoverage">
<![CDATA[
INSERT INTO forest_coverage (
particular_year ,
region ,
region_en ,
protected_lands ,
non_protected_lands ,
mountain,
non_mountain,
created_by,
created_time
) VALUES (
#{particularYear,jdbcType=VARCHAR},
#{region,jdbcType=VARCHAR},
#{regionEn,jdbcType=VARCHAR},
#{protectedLands,jdbcType=DOUBLE},
#{nonProtectedLands,jdbcType=DOUBLE},
#{mountain,jdbcType=DOUBLE},
#{nonMountain,jdbcType=DOUBLE},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}
)
]]>
</insert>
<resultMap id="RM_Upload" type="com.ruoyi.system.domain_yada.UploadFile">
<result property="id" column="id"/>
<result property="fileId" column="file_id"/>
<result property="fileName" column="file_name"/>
<result property="fileSize" column="file_size"/>
<result property="filePath" column="file_path"/>
<result property="createBy" column="created_by"/>
<result property="createTime" column="created_time"/>
</resultMap>
<insert id="IntoUpload">
<![CDATA[
INSERT INTO sys_file_info (
id ,
file_id ,
file_name ,
file_size ,
file_path ,
created_by,
created_time
) VALUES (
#{id,jdbcType=VARCHAR},
#{fileId,jdbcType=VARCHAR},
#{fileName,jdbcType=VARCHAR},
#{fileSize,jdbcType=VARCHAR},
#{filePath,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}
)
]]>
</insert>
<select id="selectUpload" resultMap="RM_Upload">
SELECT file_id,file_name,file_size,file_path,created_by,created_time FROM sys_file_info
WHERE 1=1
<if test="fileId!= null and fileId !=''">
AND fileId = #{fileId}
</if>
<if test="fileName!= null and fileName !=''">
AND file_name = #{fileName}
</if>
</select>
<resultMap id="RM_Dictionary" type="com.ruoyi.system.domain_yada.Dictionary">
<result property="codingType" column="coding_type"/>
<result property="codingType1" column="codingType1"/>
<result property="codingType2" column="codingType2"/>
<result property="dictionary" column="dictionary"/>
<result property="name" column="name"/>
<result property="nameEn" column="name_en"/>
<result property="createBy" column="created_by"/>
<result property="createTime" column="created_time"/>
</resultMap>
<sql id="columnsdic">
<![CDATA[
coding_type,dictionary,name,name_En,created_by,created_time
]]>
</sql>
<select id="selectDic" resultMap="RM_Dictionary">
select <include refid="columnsdic"/> from dictionary
where dictionary in
(SELECT A.dictionary FROM dictionary a
join (select dictionary from dictionary
where 1=1
<if test="codingType!= null and codingType !=''">
AND coding_type = #{codingType}
</if>
<if test="codingType1!= null and codingType1 !=''">
AND dictionary = #{codingType1}
</if>
) b on a.coding_type=b.dictionary
<if test="codingType2!= null and codingType2 !=''">
AND a.dictionary = #{codingType2}
</if>
)
</select>
</mapper>