| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <?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="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="pid" column="pid" jdbcType="VARCHAR"/>
- <result property="prdid" column="prdid" jdbcType="INTEGER"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <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, aid, pid, prdid, type, status, 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, aid, pid, prdid, type, status, examine_status, examine_status_other,
- buy_status, buy_status_other)
- values (#{uid}, #{aid}, #{pid}, #{prdid}, #{type}, #{status}, #{examineStatus}, #{examineStatusOther},
- #{buyStatus}, #{buyStatusOther})
- </insert>
- <insert id="insertBatch">
- insert into user_interview_project(uid, aid, pid, prdid, type, status, examine_status, examine_status_other,
- buy_status, buy_status_other)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.pid}, #{entity.prdid}, #{entity.type}, #{entity.status},
- #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus}, #{entity.buyStatusOther})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into user_interview_project(uid, aid, pid, prdid, type, status, examine_status, examine_status_other,
- buy_status, buy_status_other)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.pid}, #{entity.prdid}, #{entity.type}, #{entity.status},
- #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus}, #{entity.buyStatusOther})
- </foreach>
- on duplicate key update
- uid = values(uid),
- aid = values(aid),
- pid = values(pid),
- prdid = values(prdid),
- type = values(type),
- status = values(status),
- 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="aid != null and aid != ''">
- aid = #{aid},
- </if>
- <if test="pid != null and pid != ''">
- pid = #{pid},
- </if>
- <if test="prdid != null">
- prdid = #{prdid},
- </if>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="status != null">
- status = #{status},
- </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>
- <resultMap type="com.goafanti.common.model.UserInterviewProjectBo" id="ListMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="uid" column="uid" jdbcType="VARCHAR"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="pid" column="pid" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <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"/>
- <result property="name" column="bname" jdbcType="VARCHAR"/>
- </resultMap>
- <!--查询指定行数据-->
- <select id="findUserInterviewProjectList" resultMap="ListMap">
- select
- a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,
- b.bname name
- from user_interview_project a left join business_project b on a.pid=b.id
- <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="pid != null and pid != ''">
- and pid = #{pid}
- </if>
- <if test="prdid != null">
- and prdid = #{prdid}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="status != null">
- and status = #{status}
- </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="aid != null and aid != ''">
- and aid = #{aid}
- </if>
- <if test="pid != null and pid != ''">
- and pid = #{pid}
- </if>
- <if test="prdid != null">
- and prdid = #{prdid}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="status != null">
- and status = #{status}
- </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>
- <select id="selectByAid" resultMap="ListMap">
- select
- a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,a.type,
- b.bname name
- from user_interview_project a left join business_project b on a.pid=b.id
- <where>
- <if test="aid != null and aid != ''">
- and a.aid = #{aid}
- </if>
- <if test="uid != null and uid != ''">
- and a.uid = #{uid}
- </if>
- </where>
- </select>
- </mapper>
|