| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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.AttEfpBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttEfpBase" id="attEfpBaseResultMap">
- <result property="id" column="ID"/>
- <result property="name" column="NAME"/>
- <result property="type" column="TYPE"/>
- <result property="pro" column="PRO"/>
- <result property="bas" column="BAS"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="ord" column="ORD"/>
- <result property="proName" column="PRO_NAME"/>
- <result property="ord" column="BAS_NAME"/>
- </resultMap>
- <sql id="table_columns">
- PRO_NAME,
- BAS_NAME,
- ID,
- NAME,
- TYPE,
- PRO,
- BAS,
- ORG_ID,
- ORD
- </sql>
- <sql id="entity_properties">
- #{proName},
- #{basName},
- #{id},
- #{name},
- #{type},
- #{pro},
- #{bas},
- #{orgId},
- #{ord}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="proName != null and proName != ''">and PRO_NAME = #{proName}</if>
- <if test="basName != null and basName != ''">and BAS_NAME = #{basName}</if>
- <if test="name != null and name != ''">and NAME = #{name}</if>
- <if test="type != null and type != ''">and TYPE = #{type}</if>
- <if test="pro != null and pro != ''">and PRO = #{pro}</if>
- <if test="bas != null and bas != ''">and BAS = #{bas}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="ord != null and ord != ''">and ORD = #{ord}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attEfpBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_EFP_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attEfpBaseResultMap">
- select <include refid="table_columns" /> from ATT_EFP_BASE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attEfpBaseResultMap">
- select <include refid="table_columns" /> from ATT_EFP_BASE
- </select>
- <select id="findList" resultMap="attEfpBaseResultMap">
- select <include refid="table_columns" /> from ATT_EFP_BASE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_EFP_BASE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttEfpBase">
- insert into ATT_EFP_BASE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_EFP_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttEfpBase">
- delete from ATT_EFP_BASE <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_EFP_BASE set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttEfpBase">
- update ATT_EFP_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="basName != null and basName != ''">BAS_NAME = #{basName},</if>
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="pro != null and pro != ''">PRO = #{pro},</if>
- <if test="bas != null and bas != ''">BAS = #{bas},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="ord != null and ord != ''">ORD = #{ord},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttEfpBase">
- update ATT_EFP_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="basName != null and basName != ''">BAS_NAME = #{basName},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="pro != null and pro != ''">PRO = #{pro},</if>
- <if test="bas != null and bas != ''">BAS = #{bas},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="ord != null and ord != ''">ORD = #{ord},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|