|
|
@@ -0,0 +1,155 @@
|
|
|
+<?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.UserInterviewProjectMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.common.model.UserInterviewProject" id="UserInterviewProjectMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="uid" column="uid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="pid" column="pid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="examineStatus" column="examine_status" jdbcType="INTEGER"/>
|
|
|
+ <result property="examineStatusOther" column="examine_status_other" jdbcType="VARCHAR"/>
|
|
|
+ <result property="buyStatus" column="buy_status" jdbcType="INTEGER"/>
|
|
|
+ <result property="buyStatusOther" column="buy_status_other" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="UserInterviewProjectAllSql">
|
|
|
+ id, uid, pid, examine_status, examine_status_other, buy_status, buy_status_other
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="selectById" resultMap="UserInterviewProjectMap">
|
|
|
+ select
|
|
|
+ <include refid="UserInterviewProjectAllSql"/>
|
|
|
+ from user_interview_project
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_interview_project(uid, pid, examine_status, examine_status_other, buy_status, buy_status_other)
|
|
|
+ values (#{uid}, #{pid}, #{examineStatus}, #{examineStatusOther}, #{buyStatus}, #{buyStatusOther})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into user_interview_project(uid, pid, examine_status, examine_status_other, buy_status, buy_status_other)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.pid}, #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus},
|
|
|
+ #{entity.buyStatusOther})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_interview_project(uid, pid, examine_status, examine_status_other, buy_status, buy_status_other)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.pid}, #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus},
|
|
|
+ #{entity.buyStatusOther})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ uid = values(uid),
|
|
|
+ pid = values(pid),
|
|
|
+ examine_status = values(examine_status),
|
|
|
+ examine_status_other = values(examine_status_other),
|
|
|
+ buy_status = values(buy_status),
|
|
|
+ buy_status_other = values(buy_status_other)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update user_interview_project
|
|
|
+ <set>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="pid != null and pid != ''">
|
|
|
+ pid = #{pid},
|
|
|
+ </if>
|
|
|
+ <if test="examineStatus != null">
|
|
|
+ examine_status = #{examineStatus},
|
|
|
+ </if>
|
|
|
+ <if test="examineStatusOther != null and examineStatusOther != ''">
|
|
|
+ examine_status_other = #{examineStatusOther},
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null">
|
|
|
+ buy_status = #{buyStatus},
|
|
|
+ </if>
|
|
|
+ <if test="buyStatusOther != null and buyStatusOther != ''">
|
|
|
+ buy_status_other = #{buyStatusOther},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findUserInterviewProjectList" resultMap="UserInterviewProjectMap">
|
|
|
+ select
|
|
|
+ <include refid="UserInterviewProjectAllSql"/>
|
|
|
+
|
|
|
+ from user_interview_project
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="pid != null and pid != ''">
|
|
|
+ and pid = #{pid}
|
|
|
+ </if>
|
|
|
+ <if test="examineStatus != null">
|
|
|
+ and examine_status = #{examineStatus}
|
|
|
+ </if>
|
|
|
+ <if test="examineStatusOther != null and examineStatusOther != ''">
|
|
|
+ and examine_status_other = #{examineStatusOther}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null">
|
|
|
+ and buy_status = #{buyStatus}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatusOther != null and buyStatusOther != ''">
|
|
|
+ and buy_status_other = #{buyStatusOther}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findUserInterviewProjectCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from user_interview_project
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="pid != null and pid != ''">
|
|
|
+ and pid = #{pid}
|
|
|
+ </if>
|
|
|
+ <if test="examineStatus != null">
|
|
|
+ and examine_status = #{examineStatus}
|
|
|
+ </if>
|
|
|
+ <if test="examineStatusOther != null and examineStatusOther != ''">
|
|
|
+ and examine_status_other = #{examineStatusOther}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null">
|
|
|
+ and buy_status = #{buyStatus}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatusOther != null and buyStatusOther != ''">
|
|
|
+ and buy_status_other = #{buyStatusOther}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from user_interview_project
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|