| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <?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.AttMampuInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttMampuInfo" id="attMampuInfoResultMap">
- <result property="id" column="ID"/>
- <result property="nm" column="NM"/>
- <result property="pid" column="PID"/>
- <result property="lev" column="LEV"/>
- <result property="ord" column="ORD"/>
- <result property="regId" column="REG_ID"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" jdbcType="TIMESTAMP" column="INTM"/>
- <result property="uptm" jdbcType="TIMESTAMP" column="UPTM"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- NM,
- PID,
- LEV,
- ORD,
- REG_ID,
- PERS_ID,
- INTM,
- UPTM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{nm},
- #{pid},
- #{lev},
- #{ord},
- #{regId},
- #{persId},
- #{intm},
- #{uptm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="nm != null and nm != ''">and NM = #{nm}</if>
- <if test="pid != null and pid != ''">and PID = #{pid}</if>
- <if test="lev != null and lev != ''">and LEV = #{lev}</if>
- <if test="ord != null and ord != ''">and ORD = #{ord}</if>
- <if test="regId != null and regId != ''">and REG_ID = #{regId}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attMampuInfoResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_MAMPU_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="attMampuInfoResultMap">
- select
- <include refid="table_columns"/>
- from ATT_MAMPU_INFO
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attMampuInfoResultMap">
- select
- <include refid="table_columns"/>
- from ATT_MAMPU_INFO
- </select>
- <select id="findList" resultMap="attMampuInfoResultMap">
- select
- <include refid="table_columns"/>
- from ATT_MAMPU_INFO
- <include refid="page_where"/>
- </select>
- <select id="findByList" resultMap="attMampuInfoResultMap">
- select A.*,B.NM PIDNAME from ATT_MAMPU_INFO A LEFT JOIN ATT_MAMPU_INFO B ON A.PID=B.ID where 1=1
- <if test="nm != null and nm != ''">and A.NM = #{nm}</if>
- <if test="pid != null and pid != ''">and A.PID = #{pid}</if>
- <if test="lev != null and lev != ''">and A.LEV = #{lev}</if>
- <if test="regId != null and regId != ''">and A.REG_ID = #{regId}</if>
- order by a.intm,a.id
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_MAMPU_INFO
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttMampuInfo">
- insert into ATT_MAMPU_INFO(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_MAMPU_INFO where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttMampuInfo">
- delete from ATT_MAMPU_INFO
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_MAMPU_INFO set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttMampuInfo">
- update ATT_MAMPU_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="nm != null and nm != ''">NM = #{nm},</if>
- <if test="pid != null and pid != ''">PID = #{pid},</if>
- <if test="lev != null and lev != ''">LEV = #{lev},</if>
- <if test="ord != null and ord != ''">ORD = #{ord},</if>
- <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttMampuInfo">
- update ATT_MAMPU_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="nm != null and nm != ''">NM = #{nm},</if>
- <if test="pid != null and pid != ''">PID = #{pid},</if>
- <if test="lev != null and lev != ''">LEV = #{lev},</if>
- <if test="ord != null and ord != ''">ORD = #{ord},</if>
- <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!--根据登记表id删除-->
- <delete id="deleteByRegId" parameterType="String">
- delete from ATT_MAMPU_INFO where reg_Id = #{id}
- </delete>
- <select id="getAttMampus" resultMap="attMampuInfoResultMap">
- select
- <include refid="table_columns"/>
- from ATT_MAMPU_INFO a where 1 = 1
- <if test="regId != null and regId != ''">
- and a.reg_id in (${regId})
- </if>
- <if test="lev != null and lev != ''">
- and a.lev = #{lev}
- </if>
- </select>
- </mapper>
|