123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?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.liang.dao.BaseDegreeDao">
- <resultMap type="com.liang.entity.BaseDegree" id="BaseDegreeMap">
- <result property="Genid" column="_genid" jdbcType="INTEGER"/>
- <result property="tdi142" column="tdi142" jdbcType="VARCHAR"/>
- <result property="tdi169" column="tdi169" jdbcType="VARCHAR"/>
- </resultMap>
- <!--查询单个-->
- <select id="queryById" resultMap="BaseDegreeMap">
- select
- _genid, tdi142, tdi169
- from base_Degree
- where _genid = #{Genid}
- </select>
- <!--查询指定行数据-->
- <select id="queryAllByLimit" resultMap="BaseDegreeMap">
- select
- _genid, tdi142, tdi169
- from base_Degree
- <where>
- <if test="Genid != null">
- and _genid = #{Genid}
- </if>
- <if test="tdi142 != null and tdi142 != ''">
- and tdi142 = #{tdi142}
- </if>
- <if test="tdi169 != null and tdi169 != ''">
- and tdi169 = #{tdi169}
- </if>
- </where>
- limit #{pageable.offset}, #{pageable.pageSize}
- </select>
- <!--统计总行数-->
- <select id="count" resultType="java.lang.Long">
- select count(1)
- from base_Degree
- <where>
- <if test="Genid != null">
- and _genid = #{Genid}
- </if>
- <if test="tdi142 != null and tdi142 != ''">
- and tdi142 = #{tdi142}
- </if>
- <if test="tdi169 != null and tdi169 != ''">
- and tdi169 = #{tdi169}
- </if>
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="Genid" useGeneratedKeys="true">
- insert into base_Degree(tdi142, tdi169)
- values (#{tdi142}, #{tdi169})
- </insert>
- <insert id="insertBatch" keyProperty="Genid" useGeneratedKeys="true">
- insert into base_Degree(tdi142, tdi169)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tdi142}, #{entity.tdi169})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="Genid" useGeneratedKeys="true">
- insert into base_Degree(tdi142, tdi169)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tdi142}, #{entity.tdi169})
- </foreach>
- on duplicate key update
- tdi142 = values(tdi142),
- tdi169 = values(tdi169)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update base_Degree
- <set>
- <if test="tdi142 != null and tdi142 != ''">
- tdi142 = #{tdi142},
- </if>
- <if test="tdi169 != null and tdi169 != ''">
- tdi169 = #{tdi169},
- </if>
- </set>
- where _genid = #{Genid}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from base_Degree
- where _genid = #{Genid}
- </delete>
- <!--获取学位-->
- <select id="getDegreeList" resultType="map">
- select BM as code, MC as name
- from base_Degree
- </select>
- </mapper>
|