You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 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.BaseDtNengMapper">
<resultMap type="BaseDtNeng" id="BaseDtNengResult">
<result property="id" column="id" />
<result property="yearName" column="year_name" />
<result property="month1" column="month1" />
<result property="month2" column="month2" />
<result property="month3" column="month3" />
<result property="month4" column="month4" />
<result property="month5" column="month5" />
<result property="month6" column="month6" />
<result property="month7" column="month7" />
<result property="month8" column="month8" />
<result property="month9" column="month9" />
<result property="month10" column="month10" />
<result property="month11" column="month11" />
<result property="month12" column="month12" />
</resultMap>
<sql id="selectBaseDtNengVo">
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
</sql>
<select id="selectBaseDtNengList1" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
where year_name=to_number(to_char(sysdate,'yyyy'))
</select>
<select id="selectBaseDtNengList" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">
<include refid="selectBaseDtNengVo"/>
<where>
<if test="yearName != null "> and year_name = #{yearName}</if>
</where>
</select>
<select id="selectBaseDtNengById" parameterType="Long" resultMap="BaseDtNengResult">
<include refid="selectBaseDtNengVo"/>
where id = #{id}
</select>
<insert id="insertBaseDtNeng" parameterType="BaseDtNeng">
<selectKey keyProperty="id" resultType="long" order="BEFORE">
SELECT seq_base_dt_neng.NEXTVAL as id FROM DUAL
</selectKey>
insert into base_dt_neng
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="yearName != null">year_name,</if>
<if test="month1 != null">month1,</if>
<if test="month2 != null">month2,</if>
<if test="month3 != null">month3,</if>
<if test="month4 != null">month4,</if>
<if test="month5 != null">month5,</if>
<if test="month6 != null">month6,</if>
<if test="month7 != null">month7,</if>
<if test="month8 != null">month8,</if>
<if test="month9 != null">month9,</if>
<if test="month10 != null">month10,</if>
<if test="month11 != null">month11,</if>
<if test="month12 != null">month12,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="yearName != null">#{yearName},</if>
<if test="month1 != null">#{month1},</if>
<if test="month2 != null">#{month2},</if>
<if test="month3 != null">#{month3},</if>
<if test="month4 != null">#{month4},</if>
<if test="month5 != null">#{month5},</if>
<if test="month6 != null">#{month6},</if>
<if test="month7 != null">#{month7},</if>
<if test="month8 != null">#{month8},</if>
<if test="month9 != null">#{month9},</if>
<if test="month10 != null">#{month10},</if>
<if test="month11 != null">#{month11},</if>
<if test="month12 != null">#{month12},</if>
</trim>
</insert>
<update id="updateBaseDtNeng" parameterType="BaseDtNeng">
update base_dt_neng
<trim prefix="SET" suffixOverrides=",">
<if test="yearName != null">year_name = #{yearName},</if>
<if test="month1 != null">month1 = #{month1},</if>
<if test="month2 != null">month2 = #{month2},</if>
<if test="month3 != null">month3 = #{month3},</if>
<if test="month4 != null">month4 = #{month4},</if>
<if test="month5 != null">month5 = #{month5},</if>
<if test="month6 != null">month6 = #{month6},</if>
<if test="month7 != null">month7 = #{month7},</if>
<if test="month8 != null">month8 = #{month8},</if>
<if test="month9 != null">month9 = #{month9},</if>
<if test="month10 != null">month10 = #{month10},</if>
<if test="month11 != null">month11 = #{month11},</if>
<if test="month12 != null">month12 = #{month12},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseDtNengById" parameterType="Long">
delete from base_dt_neng where id = #{id}
</delete>
<delete id="deleteBaseDtNengByIds" parameterType="String">
delete from base_dt_neng where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>