PushMapper.xml 6.95 KB
Newer Older
xucl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
<?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.duowenlvshi.duowenlszp.model.Push.dao.PushMapper" >
  <resultMap id="BaseResultMap" type="com.duowenlvshi.duowenlszp.model.Push.entity.Push" >
    <id column="id" property="pushId" jdbcType="VARCHAR" />
    <result column="lawyer_idA" property="lawyerIda" jdbcType="VARCHAR" />
    <result column="lawyer_idB" property="lawyerIdb" jdbcType="VARCHAR" />
    <result column="job_id" property="jobId" jdbcType="VARCHAR" />
    <result column="post" property="post" jdbcType="VARCHAR" />
    <result column="yearlySalary" property="yearlysalary" jdbcType="VARCHAR" />
    <result column="city" property="city" jdbcType="VARCHAR" />
    <result column="sex" property="sex" jdbcType="VARCHAR" />
    <result column="yearsOfPractice" property="yearsofpractice" jdbcType="VARCHAR" />
    <result column="businessType" property="businesstype" jdbcType="VARCHAR" />
    <result column="expertise" property="expertise" jdbcType="VARCHAR" />
    <result column="createDate" property="createdate" jdbcType="TIMESTAMP" />
    <result column="updateDate" property="updatedate" jdbcType="TIMESTAMP" />
    <result column="isValid" property="isvalid" jdbcType="CHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, lawyer_idA, lawyer_idB, job_id, post, yearlySalary, city,cityCode, sex, yearsOfPractice,
    businessType, expertise, createDate, updateDate, isValid
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from lszp_push
    where id = #{pushId,jdbcType=VARCHAR}
  </select>

  <insert id="insertSelective" parameterType="com.duowenlvshi.duowenlszp.model.Push.entity.Push" >
    insert into lszp_push
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="pushId != null" >
        id,
      </if>
      <if test="lawyerIda != null" >
        lawyer_idA,
      </if>
      <if test="lawyerIdb != null" >
        lawyer_idB,
      </if>
      <if test="jobId != null" >
        job_id,
      </if>
      <if test="post != null" >
        post,
      </if>
      <if test="yearlysalary != null" >
        yearlySalary,
      </if>
      <if test="city != null" >
        city,
      </if>
      <if test="sex != null" >
        sex,
      </if>
      <if test="yearsofpractice != null" >
        yearsOfPractice,
      </if>
      <if test="businesstype != null" >
        businessType,
      </if>
      <if test="expertise != null" >
        expertise,
      </if>
      <if test="createdate != null" >
        createDate,
      </if>
      <if test="updatedate != null" >
        updateDate,
      </if>
      <if test="isvalid != null" >
        isValid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="pushId != null" >
        #{pushId,jdbcType=VARCHAR},
      </if>
      <if test="lawyerIda != null" >
        #{lawyerIda,jdbcType=VARCHAR},
      </if>
      <if test="lawyerIdb != null" >
        #{lawyerIdb,jdbcType=VARCHAR},
      </if>
      <if test="jobId != null" >
        #{jobId,jdbcType=VARCHAR},
      </if>
      <if test="post != null" >
        #{post,jdbcType=VARCHAR},
      </if>
      <if test="yearlysalary != null" >
        #{yearlysalary,jdbcType=VARCHAR},
      </if>
      <if test="city != null" >
        #{city,jdbcType=VARCHAR},
      </if>
      <if test="sex != null" >
        #{sex,jdbcType=VARCHAR},
      </if>
      <if test="yearsofpractice != null" >
        #{yearsofpractice,jdbcType=VARCHAR},
      </if>
      <if test="businesstype != null" >
        #{businesstype,jdbcType=VARCHAR},
      </if>
      <if test="expertise != null" >
        #{expertise,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedate != null" >
        #{updatedate,jdbcType=TIMESTAMP},
      </if>
      <if test="isvalid != null" >
        #{isvalid,jdbcType=CHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.duowenlvshi.duowenlszp.model.Push.entity.Push" >
    update lszp_push
    <set >
      <if test="lawyerIda != null" >
        lawyer_idA = #{lawyerIda,jdbcType=VARCHAR},
      </if>
      <if test="lawyerIdb != null" >
        lawyer_idB = #{lawyerIdb,jdbcType=VARCHAR},
      </if>
      <if test="jobId != null" >
        job_id = #{jobId,jdbcType=VARCHAR},
      </if>
      <if test="post != null" >
        post = #{post,jdbcType=VARCHAR},
      </if>
      <if test="yearlysalary != null" >
        yearlySalary = #{yearlysalary,jdbcType=VARCHAR},
      </if>
      <if test="city != null" >
        city = #{city,jdbcType=VARCHAR},
      </if>
      <if test="sex != null" >
        sex = #{sex,jdbcType=VARCHAR},
      </if>
      <if test="yearsofpractice != null" >
        yearsOfPractice = #{yearsofpractice,jdbcType=VARCHAR},
      </if>
      <if test="businesstype != null" >
        businessType = #{businesstype,jdbcType=VARCHAR},
      </if>
      <if test="expertise != null" >
        expertise = #{expertise,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        createDate = #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedate != null" >
        updateDate = #{updatedate,jdbcType=TIMESTAMP},
      </if>
      <if test="isvalid != null" >
        isValid = #{isvalid,jdbcType=CHAR},
      </if>
    </set>
    where id = #{pushId,jdbcType=VARCHAR}
  </update>
  <!--查询精准推送岗位列表-->
  <select id="selectByLawyerIdBList" resultType="java.util.Map" parameterType="java.util.Map" >
   SELECT
    a.id as pushId,a.lawyer_idA as lawyerIdA,b.sincerity,a.lawyer_idB as lawyerIdB ,a.job_id as jobId ,
    c.post,c.yearlySalary,c.city,c.expertise,c.businessType,c.sex,c.yearsOfPractice,
    b.logo,b.`law_firm`,b.`real_name`
    FROM lszp_push a LEFT JOIN lawyer b ON a.`lawyer_idA` = b.`id` left join lszp_job c on a.job_id = c.id
    WHERE a.lawyer_idB = #{map1.lawyerIdb} AND a.isValid="1" order by a.updateDate desc limit #{map1.page},#{map1.pageSize}
  </select>
  <!--查询精准推送岗位列表总数-->
  <select id="selectByLawyerIdBListCount" resultType="Integer" parameterType="String" >
    SELECT COUNT(1) FROM lszp_push  WHERE lawyer_idB = #{lawyerIdb} AND isValid="1"
  </select>
  <!--查询最新一条推送时间-->
  <select id="selectNewTime" resultType="java.util.Date" parameterType="String" >
    SELECT updateDate FROM lszp_push WHERE lawyer_idB=#{lawyerId} ORDER BY updateDate DESC LIMIT 0,1
  </select>
  <!--新增消息盒子表数据-->
  <insert id="insertMessage" parameterType="java.util.Map" >
    INSERT INTO message_notification (message_id,create_date,json_context,msgType,read_state,receiver_id,type,update_date)
    VALUES (#{map.messageId},#{map.createDate},#{map.jsonContext},#{map.msgType},0,#{map.receiverId},#{map.type},#{map.updateDate})
  </insert>
</mapper>