| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?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.goafanti.common.dao.UserFirstInterviewMapper">
- <resultMap type="com.goafanti.common.model.UserFirstInterview" id="UserFirstInterviewMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="uid" column="uid" jdbcType="VARCHAR"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="prid" column="prid" jdbcType="VARCHAR"/>
- <result property="firstTime" column="first_time" jdbcType="TIMESTAMP"/>
- </resultMap>
- <sql id="UserFirstInterviewAllSql">
- id, uid, aid, prid, first_time
- </sql>
- <!--查询单个-->
- <select id="selectById" resultMap="UserFirstInterviewMap">
- select
- <include refid="UserFirstInterviewAllSql"/>
- from user_first_interview
- where id = #{id}
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into user_first_interview(uid, aid, prid, first_time)
- values (#{uid}, #{aid}, #{prid}, #{firstTime})
- </insert>
- <insert id="insertBatch">
- insert into user_first_interview(uid, aid, prid, first_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.prid}, #{entity.firstTime})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into user_first_interview(uid, aid, prid, first_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.prid}, #{entity.firstTime})
- </foreach>
- on duplicate key update
- uid = values(uid),
- aid = values(aid),
- prid = values(prid),
- first_time = values(first_time)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update user_first_interview
- <set>
- <if test="uid != null and uid != ''">
- uid = #{uid},
- </if>
- <if test="aid != null and aid != ''">
- aid = #{aid},
- </if>
- <if test="prid != null and prid != ''">
- prid = #{prid},
- </if>
- <if test="firstTime != null">
- first_time = #{firstTime},
- </if>
- </set>
- where id = #{id}
- </update>
- <!--查询指定行数据-->
- <select id="findUserFirstInterviewList" resultMap="UserFirstInterviewMap">
- select
- <include refid="UserFirstInterviewAllSql"/>
- from user_first_interview
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="uid != null and uid != ''">
- and uid = #{uid}
- </if>
- <if test="aid != null and aid != ''">
- and aid = #{aid}
- </if>
- <if test="prid != null and prid != ''">
- and prid = #{prid}
- </if>
- <if test="firstTime != null">
- and first_time = #{firstTime}
- </if>
- </where>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <!--统计总行数-->
- <select id="findUserFirstInterviewCount" resultType="java.lang.Integer">
- select count(1)
- from user_first_interview
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="uid != null and uid != ''">
- and uid = #{uid}
- </if>
- <if test="aid != null and aid != ''">
- and aid = #{aid}
- </if>
- <if test="prid != null and prid != ''">
- and prid = #{prid}
- </if>
- <if test="firstTime != null">
- and first_time = #{firstTime}
- </if>
- </where>
- </select>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from user_first_interview
- where id = #{id}
- </delete>
- </mapper>
|