| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <?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.AttBasBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttBasBase" id="attBasBaseResultMap">
- <result property="basCode" column="BAS_CODE"/>
- <result property="basName" column="BAS_NAME"/>
- <result property="crOverType" column="CR_OVER_TYPE"/>
- <result property="basAdName" column="BAS_AD_NAME"/>
- <result property="basGrad" column="BAS_GRAD"/>
- <result property="basArea" column="BAS_AREA"/>
- <result property="meaAnnPrec" column="MEA_ANN_PREC"/>
- <result property="meaAnnDept" column="MEA_ANN_DEPT"/>
- <result property="meaAnnRuof" column="MEA_ANN_RUOF"/>
- <result property="note" column="NOTE"/>
- <result property="effDate" column="EFF_DATE"/>
- <result property="exprDate" column="EXPR_DATE"/>
- </resultMap>
- <sql id="table_columns">
- BAS_CODE,
- BAS_NAME,
- CR_OVER_TYPE,
- BAS_AD_NAME,
- BAS_GRAD,
- BAS_AREA,
- MEA_ANN_PREC,
- MEA_ANN_DEPT,
- MEA_ANN_RUOF,
- NOTE,
- EFF_DATE,
- EXPR_DATE
- </sql>
- <sql id="entity_properties">
- #{basCode},
- #{basName},
- #{crOverType},
- #{basAdName},
- #{basGrad},
- #{basArea},
- #{meaAnnPrec},
- #{meaAnnDept},
- #{meaAnnRuof},
- #{note},
- #{effDate},
- #{exprDate}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="basName != null and basName != ''">and BAS_NAME = #{basName}</if>
- <if test="crOverType != null and crOverType != ''">and CR_OVER_TYPE = #{crOverType}</if>
- <if test="basAdName != null and basAdName != ''">and BAS_AD_NAME = #{basAdName}</if>
- <if test="basGrad != null and basGrad != ''">and BAS_GRAD = #{basGrad}</if>
- <if test="basArea != null and basArea != ''">and BAS_AREA = #{basArea}</if>
- <if test="meaAnnPrec != null and meaAnnPrec != ''">and MEA_ANN_PREC = #{meaAnnPrec}</if>
- <if test="meaAnnDept != null and meaAnnDept != ''">and MEA_ANN_DEPT = #{meaAnnDept}</if>
- <if test="meaAnnRuof != null and meaAnnRuof != ''">and MEA_ANN_RUOF = #{meaAnnRuof}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="effDate != null">and EFF_DATE = #{effDate}</if>
- <if test="exprDate != null">and EXPR_DATE = #{exprDate}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attBasBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_BAS_BASE where BAS_CODE = #{id}
- </select>
- <select id="getBy" resultMap="attBasBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_BAS_BASE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attBasBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_BAS_BASE
- </select>
- <select id="findList" resultMap="attBasBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_BAS_BASE
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_BAS_BASE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttBasBase">
- insert into ATT_BAS_BASE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_BAS_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttBasBase">
- delete from ATT_BAS_BASE
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_BAS_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttBasBase">
- update ATT_BAS_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="basName != null and basName != ''">BAS_NAME = #{basName},</if>
- <if test="crOverType != null and crOverType != ''">CR_OVER_TYPE = #{crOverType},</if>
- <if test="basAdName != null and basAdName != ''">BAS_AD_NAME = #{basAdName},</if>
- <if test="basGrad != null and basGrad != ''">BAS_GRAD = #{basGrad},</if>
- <if test="basArea != null and basArea != ''">BAS_AREA = #{basArea},</if>
- <if test="meaAnnPrec != null and meaAnnPrec != ''">MEA_ANN_PREC = #{meaAnnPrec},</if>
- <if test="meaAnnDept != null and meaAnnDept != ''">MEA_ANN_DEPT = #{meaAnnDept},</if>
- <if test="meaAnnRuof != null and meaAnnRuof != ''">MEA_ANN_RUOF = #{meaAnnRuof},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null">EFF_DATE = #{effDate},</if>
- <if test="exprDate != null">EXPR_DATE = #{exprDate},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttBasBase">
- update ATT_BAS_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="basName != null and basName != ''">BAS_NAME = #{basName},</if>
- <if test="crOverType != null and crOverType != ''">CR_OVER_TYPE = #{crOverType},</if>
- <if test="basAdName != null and basAdName != ''">BAS_AD_NAME = #{basAdName},</if>
- <if test="basGrad != null and basGrad != ''">BAS_GRAD = #{basGrad},</if>
- <if test="basArea != null and basArea != ''">BAS_AREA = #{basArea},</if>
- <if test="meaAnnPrec != null and meaAnnPrec != ''">MEA_ANN_PREC = #{meaAnnPrec},</if>
- <if test="meaAnnDept != null and meaAnnDept != ''">MEA_ANN_DEPT = #{meaAnnDept},</if>
- <if test="meaAnnRuof != null and meaAnnRuof != ''">MEA_ANN_RUOF = #{meaAnnRuof},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null">EFF_DATE = #{effDate},</if>
- <if test="exprDate != null">EXPR_DATE = #{exprDate},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="selectMax" resultType="int">
- select max(to_number(t.BAS_CODE)) from ATT_BAS_BASE t
- </select>
- </mapper>
|