|
@@ -0,0 +1,165 @@
|
|
|
|
|
+<?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.dgtly.system.mapper.WxQyUserMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="WxQyUser" id="WxQyUserResult">
|
|
|
|
|
+ <result property="userid" column="userid" />
|
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
|
|
+ <!--<result property="department" column="department" />-->
|
|
|
|
|
+ <!--<result property="order" column="order" />-->
|
|
|
|
|
+ <result property="position" column="position" />
|
|
|
|
|
+ <result property="gender" column="gender" />
|
|
|
|
|
+ <result property="email" column="email" />
|
|
|
|
|
+ <!--<result property="isLeaderInDept" column="is_leader_in_dept" />-->
|
|
|
|
|
+ <result property="avatar" column="avatar" />
|
|
|
|
|
+ <result property="thumbAvatar" column="thumb_avatar" />
|
|
|
|
|
+ <result property="telephone" column="telephone" />
|
|
|
|
|
+ <result property="alias" column="alias" />
|
|
|
|
|
+ <!--<result property="extattr" column="extattr" />-->
|
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
|
+ <result property="qrCode" column="qr_code" />
|
|
|
|
|
+ <result property="externalProfile" column="external_profile" />
|
|
|
|
|
+ <result property="address" column="address" />
|
|
|
|
|
+ <result property="openUserid" column="open_userid" />
|
|
|
|
|
+ <result property="mainDepartment" column="main_department" />
|
|
|
|
|
+ <result property="sysUserId" column="sys_user_id" />
|
|
|
|
|
+ <result property="json" column="json" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectWxQyUserVo">
|
|
|
|
|
+ select userid, name, mobile, position, gender, email, avatar, thumb_avatar, telephone, alias, status, qr_code, external_profile, address, open_userid, main_department, sys_user_id,json from wx_qy_user
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectWxQyUserList" parameterType="WxQyUser" resultMap="WxQyUserResult">
|
|
|
|
|
+ <include refid="selectWxQyUserVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
+ <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
|
|
|
|
|
+ <!--<if test="department != null and department != ''"> and department = #{department}</if>-->
|
|
|
|
|
+ <!--<if test="order != null and order != ''"> and order = #{order}</if>-->
|
|
|
|
|
+ <if test="position != null and position != ''"> and position = #{position}</if>
|
|
|
|
|
+ <if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
|
|
|
+ <if test="email != null and email != ''"> and email = #{email}</if>
|
|
|
|
|
+ <!--<if test="isLeaderInDept != null and isLeaderInDept != ''"> and is_leader_in_dept = #{isLeaderInDept}</if>-->
|
|
|
|
|
+ <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
|
|
|
|
+ <if test="thumbAvatar != null and thumbAvatar != ''"> and thumb_avatar = #{thumbAvatar}</if>
|
|
|
|
|
+ <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
|
|
|
|
|
+ <if test="alias != null and alias != ''"> and alias = #{alias}</if>
|
|
|
|
|
+ <!--<if test="extattr != null and extattr != ''"> and extattr = #{extattr}</if>-->
|
|
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
|
|
+ <if test="externalProfile != null and externalProfile != ''"> and external_profile = #{externalProfile}</if>
|
|
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
|
|
+ <if test="openUserid != null and openUserid != ''"> and open_userid = #{openUserid}</if>
|
|
|
|
|
+ <if test="mainDepartment != null and mainDepartment != ''"> and main_department = #{mainDepartment}</if>
|
|
|
|
|
+ <if test="sysUserId != null "> and sys_user_id = #{sysUserId}</if>
|
|
|
|
|
+
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectWxQyUserById" parameterType="String" resultMap="WxQyUserResult">
|
|
|
|
|
+ <include refid="selectWxQyUserVo"/>
|
|
|
|
|
+ where userid = #{userid}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertWxQyUser" parameterType="WxQyUser">
|
|
|
|
|
+ insert into wx_qy_user
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userid != null and userid != ''">userid,</if>
|
|
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
|
|
+ <if test="mobile != null and mobile != ''">mobile,</if>
|
|
|
|
|
+ <!--<if test="department != null and department != ''">department,</if>-->
|
|
|
|
|
+ <!--<if test="order != null and order != ''">order,</if>-->
|
|
|
|
|
+ <if test="position != null and position != ''">position,</if>
|
|
|
|
|
+ <if test="gender != null and gender != ''">gender,</if>
|
|
|
|
|
+ <if test="email != null and email != ''">email,</if>
|
|
|
|
|
+ <!--<if test="isLeaderInDept != null and isLeaderInDept != ''">is_leader_in_dept,</if>-->
|
|
|
|
|
+ <if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
|
|
+ <if test="thumbAvatar != null and thumbAvatar != ''">thumb_avatar,</if>
|
|
|
|
|
+ <if test="telephone != null and telephone != ''">telephone,</if>
|
|
|
|
|
+ <if test="alias != null and alias != ''">alias,</if>
|
|
|
|
|
+ <!--<if test="extattr != null and extattr != ''">extattr,</if>-->
|
|
|
|
|
+ <if test="status != null and status != ''">status,</if>
|
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">qr_code,</if>
|
|
|
|
|
+ <if test="externalProfile != null and externalProfile != ''">external_profile,</if>
|
|
|
|
|
+ <if test="address != null and address != ''">address,</if>
|
|
|
|
|
+ <if test="openUserid != null and openUserid != ''">open_userid,</if>
|
|
|
|
|
+ <if test="mainDepartment != null and mainDepartment != ''">main_department,</if>
|
|
|
|
|
+ <if test="sysUserId != null ">sys_user_id,</if>
|
|
|
|
|
+ <if test="json != null ">json,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userid != null and userid != ''">#{userid},</if>
|
|
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
|
|
+ <if test="mobile != null and mobile != ''">#{mobile},</if>
|
|
|
|
|
+ <!--<if test="department != null and department != ''">#{department},</if>-->
|
|
|
|
|
+ <!--<if test="order != null and order != ''">#{order},</if>-->
|
|
|
|
|
+ <if test="position != null and position != ''">#{position},</if>
|
|
|
|
|
+ <if test="gender != null and gender != ''">#{gender},</if>
|
|
|
|
|
+ <if test="email != null and email != ''">#{email},</if>
|
|
|
|
|
+ <!--<if test="isLeaderInDept != null and isLeaderInDept != ''">#{isLeaderInDept},</if>-->
|
|
|
|
|
+ <if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
|
|
+ <if test="thumbAvatar != null and thumbAvatar != ''">#{thumbAvatar},</if>
|
|
|
|
|
+ <if test="telephone != null and telephone != ''">#{telephone},</if>
|
|
|
|
|
+ <if test="alias != null and alias != ''">#{alias},</if>
|
|
|
|
|
+ <!--<if test="extattr != null and extattr != ''">#{extattr},</if>-->
|
|
|
|
|
+ <if test="status != null and status != ''">#{status},</if>
|
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">#{qrCode},</if>
|
|
|
|
|
+ <if test="externalProfile != null and externalProfile != ''">#{externalProfile},</if>
|
|
|
|
|
+ <if test="address != null and address != ''">#{address},</if>
|
|
|
|
|
+ <if test="openUserid != null and openUserid != ''">#{openUserid},</if>
|
|
|
|
|
+ <if test="mainDepartment != null and mainDepartment != ''">#{mainDepartment},</if>
|
|
|
|
|
+ <if test="sysUserId != null ">#{sysUserId},</if>
|
|
|
|
|
+ <if test="json != null ">#{json},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateWxQyUser" parameterType="WxQyUser">
|
|
|
|
|
+ update wx_qy_user
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
|
+ <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
|
|
|
|
+ <!--<if test="department != null and department != ''">department = #{department},</if>-->
|
|
|
|
|
+ <!--<if test="order != null and order != ''">order = #{order},</if>-->
|
|
|
|
|
+ <if test="position != null and position != ''">position = #{position},</if>
|
|
|
|
|
+ <if test="gender != null and gender != ''">gender = #{gender},</if>
|
|
|
|
|
+ <if test="email != null and email != ''">email = #{email},</if>
|
|
|
|
|
+ <!--<if test="isLeaderInDept != null and isLeaderInDept != ''">is_leader_in_dept = #{isLeaderInDept},</if>-->
|
|
|
|
|
+ <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
|
|
|
+ <if test="thumbAvatar != null and thumbAvatar != ''">thumb_avatar = #{thumbAvatar},</if>
|
|
|
|
|
+ <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
|
|
|
|
|
+ <if test="alias != null and alias != ''">alias = #{alias},</if>
|
|
|
|
|
+ <!--<if test="extattr != null and extattr != ''">extattr = #{extattr},</if>-->
|
|
|
|
|
+ <if test="status != null and status != ''">status = #{status},</if>
|
|
|
|
|
+ <if test="qrCode != null and qrCode != ''">qr_code = #{qrCode},</if>
|
|
|
|
|
+ <if test="externalProfile != null and externalProfile != ''">external_profile = #{externalProfile},</if>
|
|
|
|
|
+ <if test="address != null and address != ''">address = #{address},</if>
|
|
|
|
|
+ <if test="openUserid != null and openUserid != ''">open_userid = #{openUserid},</if>
|
|
|
|
|
+ <if test="mainDepartment != null and mainDepartment != ''">main_department = #{mainDepartment},</if>
|
|
|
|
|
+ <if test="sysUserId != null ">sys_user_id = #{sysUserId},</if>
|
|
|
|
|
+ <if test="json != null "> json = #{json},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where userid = #{userid}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteWxQyUserById" parameterType="String">
|
|
|
|
|
+ delete from wx_qy_user where userid = #{userid}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteWxQyUserByIds" parameterType="String">
|
|
|
|
|
+ delete from wx_qy_user where userid in
|
|
|
|
|
+ <foreach item="userid" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{userid}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="bondedSysUserBySysUserId" parameterType="Long">
|
|
|
|
|
+ update wx_qy_user
|
|
|
|
|
+ set sys_user_id = null
|
|
|
|
|
+ where sys_user_id = #{sysUserId}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|