|
@@ -0,0 +1,119 @@
|
|
|
+<?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.ruoyi.system.mapper.CpsMeetingUsrMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.system.domain.CpsMeetingUsr" id="CpsMeetingUsrResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="usrName" column="usr_name"/>
|
|
|
+ <result property="tel" column="tel"/>
|
|
|
+ <result property="openId" column="open_id"/>
|
|
|
+ <result property="enterpriseId" column="enterprise_id"/>
|
|
|
+ <result property="tripId" column="trip_id"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCpsMeetingUsrVo">
|
|
|
+ SELECT usr.id,
|
|
|
+ usr_name,
|
|
|
+ usr.tel,
|
|
|
+ open_id,
|
|
|
+ usr.enterprise_id,
|
|
|
+ usr.trip_id,
|
|
|
+ trip.trip_name,
|
|
|
+ avatar_url,
|
|
|
+ enterprise.enterprise_name,
|
|
|
+ usr.update_time,
|
|
|
+ usr.create_time,
|
|
|
+ usr.create_by,
|
|
|
+ usr.update_by
|
|
|
+ FROM cps_meeting_usr usr
|
|
|
+ LEFT JOIN cps_meeting_enterprise enterprise ON usr.enterprise_id = enterprise.id
|
|
|
+ LEFT JOIN cps_meeting_enterprise_trip_info trip ON usr.trip_id = trip.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCpsMeetingUsrList" parameterType="com.ruoyi.system.domain.CpsMeetingUsr"
|
|
|
+ resultType="com.ruoyi.system.domain.CpsMeetingUsr">
|
|
|
+ <include refid="selectCpsMeetingUsrVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="usrName != null and usrName != ''">and usr_name like concat('%', #{usrName}, '%')</if>
|
|
|
+ <if test="tel != null and tel != ''">and usr.tel = #{tel}</if>
|
|
|
+ <if test="openId != null and openId != ''">and open_id = #{openId}</if>
|
|
|
+ <if test="enterpriseId != null ">and usr.enterprise_id = #{enterpriseId}</if>
|
|
|
+ <if test="tripId != null ">and usr.trip_id = #{tripId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCpsMeetingUsrById" parameterType="Long" resultMap="CpsMeetingUsrResult">
|
|
|
+ <include refid="selectCpsMeetingUsrVo"/>
|
|
|
+ where usr.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCpsMeetingUsr" parameterType="com.ruoyi.system.domain.CpsMeetingUsr" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into cps_meeting_usr
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="usrName != null">usr_name,</if>
|
|
|
+ <if test="tel != null">tel,</if>
|
|
|
+ <if test="openId != null">open_id,</if>
|
|
|
+ <if test="enterpriseId != null">enterprise_id,</if>
|
|
|
+ <if test="tripId != null">trip_id,</if>
|
|
|
+ <if test="avatarUrl != null">avatar_url,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="usrName != null">#{usrName},</if>
|
|
|
+ <if test="tel != null">#{tel},</if>
|
|
|
+ <if test="openId != null">#{openId},</if>
|
|
|
+ <if test="enterpriseId != null">#{enterpriseId},</if>
|
|
|
+ <if test="tripId != null">#{tripId},</if>
|
|
|
+ <if test="avatarUrl != null">#{avatarUrl},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCpsMeetingUsr" parameterType="com.ruoyi.system.domain.CpsMeetingUsr">
|
|
|
+ update cps_meeting_usr
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="usrName != null">usr_name = #{usrName},</if>
|
|
|
+ <if test="tel != null">tel = #{tel},</if>
|
|
|
+ <if test="openId != null">open_id = #{openId},</if>
|
|
|
+ <if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
|
|
|
+ <if test="tripId != null">trip_id = #{tripId},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCpsMeetingUsrById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from cps_meeting_usr
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCpsMeetingUsrByIds" parameterType="String">
|
|
|
+ delete from cps_meeting_usr where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <select id="exitUser" resultType="java.lang.Integer">
|
|
|
+ -- 判断是否存在openid的数据
|
|
|
+ select count(1)
|
|
|
+ from cps_meeting_usr
|
|
|
+ where open_id = #{openId}
|
|
|
+ </select>
|
|
|
+</mapper>
|