| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <?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.UserArchivesInterviewMapper">
- <resultMap type="com.goafanti.common.model.UserArchivesInterview" id="UserArchivesInterviewMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="uid" column="uid" jdbcType="VARCHAR"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="prdid" column="prdid" jdbcType="INTEGER"/>
- <result property="counts" column="counts" jdbcType="INTEGER"/>
- <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
- <result property="customerDemand" column="customer_demand" jdbcType="VARCHAR"/>
- <result property="interviewIdeas" column="interview_ideas" jdbcType="VARCHAR"/>
- <result property="interviewPurpose" column="interview_purpose" jdbcType="VARCHAR"/>
- <result property="interviewRecommend" column="interview_recommend" jdbcType="VARCHAR"/>
- <result property="interviewFeedback" column="interview_feedback" jdbcType="VARCHAR"/>
- <result property="followUpPlan" column="follow_up_plan" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- </resultMap>
- <sql id="UserArchivesInterviewAllSql">
- id, uid, aid, prdid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan, create_time
- </sql>
- <!--查询单个-->
- <select id="selectById" resultMap="UserArchivesInterviewMap">
- select
- <include refid="UserArchivesInterviewAllSql"/>
- from user_archives_interview
- where id = #{id}
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand,
- interview_ideas, interview_purpose, interview_recommend, interview_feedback,
- follow_up_plan, create_time)
- values (#{uid}, #{aid}, #{prdid}, #{counts}, #{earlyCommunication}, #{customerDemand}, #{interviewIdeas},
- #{interviewPurpose}, #{interviewRecommend}, #{interviewFeedback}, #{followUpPlan}, #{createTime})
- </insert>
- <insert id="insertBatch">
- insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand,
- interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.prdid}, #{entity.counts}, #{entity.earlyCommunication},
- #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose},
- #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan}, #{entity.createTime})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand,
- interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.uid}, #{entity.aid}, #{entity.prdid}, #{entity.counts}, #{entity.earlyCommunication},
- #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose},
- #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan}, #{entity.createTime})
- </foreach>
- on duplicate key update
- uid = values(uid),
- aid = values(aid),
- prdid = values(prdid),
- counts = values(counts),
- early_communication = values(early_communication),
- customer_demand = values(customer_demand),
- interview_ideas = values(interview_ideas),
- interview_purpose = values(interview_purpose),
- interview_recommend = values(interview_recommend),
- interview_feedback = values(interview_feedback),
- follow_up_plan = values(follow_up_plan),
- create_time = values(create_time)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update user_archives_interview
- <set>
- <if test="uid != null and uid != ''">
- uid = #{uid},
- </if>
- <if test="aid != null and aid != ''">
- aid = #{aid},
- </if>
- <if test="prdid != null">
- prdid = #{prdid},
- </if>
- <if test="counts != null">
- counts = #{counts},
- </if>
- <if test="earlyCommunication != null and earlyCommunication != ''">
- early_communication = #{earlyCommunication},
- </if>
- <if test="customerDemand != null and customerDemand != ''">
- customer_demand = #{customerDemand},
- </if>
- <if test="interviewIdeas != null and interviewIdeas != ''">
- interview_ideas = #{interviewIdeas},
- </if>
- <if test="interviewPurpose != null and interviewPurpose != ''">
- interview_purpose = #{interviewPurpose},
- </if>
- <if test="interviewRecommend != null and interviewRecommend != ''">
- interview_recommend = #{interviewRecommend},
- </if>
- <if test="interviewFeedback != null and interviewFeedback != ''">
- interview_feedback = #{interviewFeedback},
- </if>
- <if test="followUpPlan != null and followUpPlan != ''">
- follow_up_plan = #{followUpPlan},
- </if>
- <if test="createTime != null">
- create_time = #{createTime},
- </if>
- </set>
- where id = #{id}
- </update>
- <!--查询指定行数据-->
- <select id="findUserArchivesInterviewList" resultMap="UserArchivesInterviewMap">
- select
- <include refid="UserArchivesInterviewAllSql"/>
- from user_archives_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="prdid != null">
- and prdid = #{prdid}
- </if>
- <if test="counts != null">
- and counts = #{counts}
- </if>
- <if test="earlyCommunication != null and earlyCommunication != ''">
- and early_communication = #{earlyCommunication}
- </if>
- <if test="customerDemand != null and customerDemand != ''">
- and customer_demand = #{customerDemand}
- </if>
- <if test="interviewIdeas != null and interviewIdeas != ''">
- and interview_ideas = #{interviewIdeas}
- </if>
- <if test="interviewPurpose != null and interviewPurpose != ''">
- and interview_purpose = #{interviewPurpose}
- </if>
- <if test="interviewRecommend != null and interviewRecommend != ''">
- and interview_recommend = #{interviewRecommend}
- </if>
- <if test="interviewFeedback != null and interviewFeedback != ''">
- and interview_feedback = #{interviewFeedback}
- </if>
- <if test="followUpPlan != null and followUpPlan != ''">
- and follow_up_plan = #{followUpPlan}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- </where>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
- <!--统计总行数-->
- <select id="findUserArchivesInterviewCount" resultType="java.lang.Integer">
- select count(1)
- from user_archives_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="prdid != null">
- and prdid = #{prdid}
- </if>
- <if test="counts != null">
- and counts = #{counts}
- </if>
- <if test="earlyCommunication != null and earlyCommunication != ''">
- and early_communication = #{earlyCommunication}
- </if>
- <if test="customerDemand != null and customerDemand != ''">
- and customer_demand = #{customerDemand}
- </if>
- <if test="interviewIdeas != null and interviewIdeas != ''">
- and interview_ideas = #{interviewIdeas}
- </if>
- <if test="interviewPurpose != null and interviewPurpose != ''">
- and interview_purpose = #{interviewPurpose}
- </if>
- <if test="interviewRecommend != null and interviewRecommend != ''">
- and interview_recommend = #{interviewRecommend}
- </if>
- <if test="interviewFeedback != null and interviewFeedback != ''">
- and interview_feedback = #{interviewFeedback}
- </if>
- <if test="followUpPlan != null and followUpPlan != ''">
- and follow_up_plan = #{followUpPlan}
- </if>
- <if test="createTime != null">
- and create_time = #{createTime}
- </if>
- </where>
- </select>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from user_archives_interview
- where id = #{id}
- </delete>
- <resultMap type="com.goafanti.Interview.bo.selectByUidAidBo" id="selectByUidAidBoMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="uid" column="uid" jdbcType="VARCHAR"/>
- <result property="aid" column="aid" jdbcType="VARCHAR"/>
- <result property="prdid" column="prdid" jdbcType="INTEGER"/>
- <result property="counts" column="counts" jdbcType="INTEGER"/>
- <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
- <result property="customerDemand" column="customer_demand" jdbcType="VARCHAR"/>
- <result property="interviewIdeas" column="interview_ideas" jdbcType="VARCHAR"/>
- <result property="interviewPurpose" column="interview_purpose" jdbcType="VARCHAR"/>
- <result property="interviewRecommend" column="interview_recommend" jdbcType="VARCHAR"/>
- <result property="interviewFeedback" column="interview_feedback" jdbcType="VARCHAR"/>
- <result property="followUpPlan" column="follow_up_plan" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="prStatus" column="prStatus" jdbcType="INTEGER"/>
- <result property="adminName" column="name" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="selectByUidAid" resultMap="selectByUidAidBoMap">
- select
- a.* ,c.status prStatus,d.name
- from user_archives_interview a left join public_release_details b on a.prdid=b.id
- left join public_release c on b.prid=c.id left join admin d on a.aid=d.id
- <where>
- <if test="uid != null and uid != ''">
- and a.uid = #{uid}
- </if>
- <if test="aid != null and aid != ''">
- and a.aid = #{aid}
- </if>
- </where>
- order by a.counts desc
- </select>
- <select id="selectByIds" resultMap="UserArchivesInterviewMap">
- select
- <include refid="UserArchivesInterviewAllSql"/>
- from user_archives_interview
- where id in
- <foreach collection="array" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </select>
- <select id="selectByPrdid" resultMap="UserArchivesInterviewMap">
- select
- <include refid="UserArchivesInterviewAllSql"/>
- from user_archives_interview
- where prdid = #{prdid}
- </select>
- </mapper>
|