From 59e91a4e9ddaf23cebb12993c774aa899ab22d16 Mon Sep 17 00:00:00 2001
From: 郑永安 <zyazyz250@sina.com>
Date: Mon, 19 Jun 2023 14:22:45 +0800
Subject: [PATCH] 描述
---
src/main/java/com/gk/firework/Mapper/mybatis/UserInfoMapper.xml | 417 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 417 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/gk/firework/Mapper/mybatis/UserInfoMapper.xml b/src/main/java/com/gk/firework/Mapper/mybatis/UserInfoMapper.xml
new file mode 100644
index 0000000..97199d7
--- /dev/null
+++ b/src/main/java/com/gk/firework/Mapper/mybatis/UserInfoMapper.xml
@@ -0,0 +1,417 @@
+<?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.gk.firework.Mapper.UserInfoMapper" >
+ <resultMap id="BaseResultMap" type="com.gk.firework.Domain.UserInfo" >
+ <!-- -->
+ <id column="id" property="id" jdbcType="BIGINT" />
+ <result column="username" property="username" jdbcType="VARCHAR" />
+ <result column="password" property="password" jdbcType="VARCHAR" />
+ <result column="email" property="email" jdbcType="VARCHAR" />
+ <result column="phone" property="phone" jdbcType="VARCHAR" />
+ <result column="mobile" property="mobile" jdbcType="VARCHAR" />
+ <result column="company" property="company" jdbcType="VARCHAR" />
+ <result column="department" property="department" jdbcType="VARCHAR" />
+ <result column="job" property="job" jdbcType="VARCHAR" />
+ <result column="createdby" property="createdby" jdbcType="VARCHAR" />
+ <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
+ <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" />
+ <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" />
+ <result column="province" property="province" jdbcType="VARCHAR" />
+ <result column="city" property="city" jdbcType="VARCHAR" />
+ <result column="area" property="area" jdbcType="VARCHAR" />
+ <result column="town" property="town" jdbcType="VARCHAR" />
+ <result column="community" property="community" jdbcType="VARCHAR" />
+ <result column="companyid" property="companyid" jdbcType="BIGINT" />
+ <result column="status" property="status" jdbcType="TINYINT" />
+ <result column="expiredate" property="expiredate" jdbcType="TIMESTAMP" />
+ <result column="isdel" property="isdel" jdbcType="TINYINT" />
+ <result column="issale" property="issale" jdbcType="TINYINT" />
+ <result column="type" property="type" jdbcType="INTEGER" />
+ <result column="deadline" property="deadline" jdbcType="TIMESTAMP" />
+ </resultMap>
+
+ <resultMap id="UserVo" type="com.gk.firework.Domain.Vo.UserVo" >
+ <id column="id" property="id" jdbcType="BIGINT" />
+ <result column="username" property="username" jdbcType="VARCHAR" />
+ <result column="password" property="password" jdbcType="VARCHAR" />
+ <result column="email" property="email" jdbcType="VARCHAR" />
+ <result column="phone" property="phone" jdbcType="VARCHAR" />
+ <result column="mobile" property="mobile" jdbcType="VARCHAR" />
+ <result column="company" property="company" jdbcType="VARCHAR" />
+ <result column="department" property="department" jdbcType="VARCHAR" />
+ <result column="job" property="job" jdbcType="VARCHAR" />
+ <result column="createdby" property="createdby" jdbcType="VARCHAR" />
+ <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
+ <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" />
+ <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" />
+ <result column="province" property="province" jdbcType="VARCHAR" />
+ <result column="city" property="city" jdbcType="VARCHAR" />
+ <result column="area" property="area" jdbcType="VARCHAR" />
+ <result column="town" property="town" jdbcType="VARCHAR" />
+ <result column="code" property="code" jdbcType="VARCHAR" />
+ <result column="community" property="community" jdbcType="VARCHAR" />
+ <result column="companyid" property="companyid" jdbcType="BIGINT" />
+ <result column="companynumber" property="companynumber" jdbcType="VARCHAR" />
+ <result column="status" property="status" jdbcType="TINYINT" />
+ <result column="expiredate" property="expiredate" jdbcType="TIMESTAMP" />
+ <result column="isdel" property="isdel" jdbcType="TINYINT" />
+ <result column="issale" property="issale" jdbcType="TINYINT" />
+ <result column="type" property="type" jdbcType="INTEGER" />
+ <result column="deadline" property="deadline" jdbcType="TIMESTAMP" />
+ <collection property="authorizationCodes"
+ javaType="java.util.List"
+ ofType="com.gk.firework.Domain.AuthorizationInfo"
+ column="companynumber"
+ select="selectAuth">
+ <id column="auth_id" property="id" jdbcType="BIGINT" />
+ <result column="enterprisenumber" property="enterprisenumber" jdbcType="VARCHAR" />
+ <result column="authcode" property="authcode" jdbcType="VARCHAR" />
+ <result column="authcodeprefix" property="authcodeprefix" jdbcType="VARCHAR" />
+ <result column="contractcode" property="contractcode" jdbcType="VARCHAR" />
+ <result column="createdat" property="createdat" jdbcType="TIMESTAMP" />
+ <result column="createdby" property="createdby" jdbcType="VARCHAR" />
+ <result column="safetysupervision" property="safetysupervision" jdbcType="VARCHAR" />
+ <result column="flag" property="flag" jdbcType="TINYINT" />
+ <result column="lasttime" property="lasttime" jdbcType="TIMESTAMP" />
+ <result column="auth_status" property="status" jdbcType="TINYINT" />
+ </collection>
+ </resultMap>
+ <sql id="Base_Column_List" >
+ <!-- -->
+ id, username, password, email, phone, mobile, company, department, job, createdby,
+ createddate, lastmodifiedby, lastmodifieddate, province, city, area, town, community,
+ companyid, status, expiredate, isdel, issale,type
+ </sql>
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+ <!-- -->
+ select
+ <include refid="Base_Column_List" />
+ from user
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+ <!-- -->
+ delete from user
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <delete id="deleteOneByCompanyId" parameterType="java.lang.Long">
+ update user
+ set isdel = 1
+ where companyid = #{companyId}
+ </delete>
+ <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.UserInfo" >
+ <!-- -->
+ update user
+ <set >
+ <if test="username != null" >
+ username = #{username,jdbcType=VARCHAR},
+ </if>
+ <if test="password != null" >
+ password = #{password,jdbcType=VARCHAR},
+ </if>
+ <if test="email != null" >
+ email = #{email,jdbcType=VARCHAR},
+ </if>
+ <if test="phone != null" >
+ phone = #{phone,jdbcType=VARCHAR},
+ </if>
+ <if test="mobile != null" >
+ mobile = #{mobile,jdbcType=VARCHAR},
+ </if>
+ <if test="company != null" >
+ company = #{company,jdbcType=VARCHAR},
+ </if>
+ <if test="department != null" >
+ department = #{department,jdbcType=VARCHAR},
+ </if>
+ <if test="job != null" >
+ job = #{job,jdbcType=VARCHAR},
+ </if>
+ <if test="createdby != null" >
+ createdby = #{createdby,jdbcType=VARCHAR},
+ </if>
+ <if test="createddate != null" >
+ createddate = #{createddate,jdbcType=TIMESTAMP},
+ </if>
+ <if test="lastmodifiedby != null" >
+ lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR},
+ </if>
+ <if test="lastmodifieddate != null" >
+ lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP},
+ </if>
+ <if test="province != null" >
+ province = #{province,jdbcType=VARCHAR},
+ </if>
+ <if test="city != null" >
+ city = #{city,jdbcType=VARCHAR},
+ </if>
+ <if test="area != null" >
+ area = #{area,jdbcType=VARCHAR},
+ </if>
+ <if test="town != null" >
+ town = #{town,jdbcType=VARCHAR},
+ </if>
+ <if test="community != null" >
+ community = #{community,jdbcType=VARCHAR},
+ </if>
+ <if test="companyid != null" >
+ companyid = #{companyid,jdbcType=BIGINT},
+ </if>
+ <if test="companynumber != null" >
+ #{companynumber,jdbcType=VARCHAR},
+ </if>
+ <if test="status != null" >
+ status = #{status,jdbcType=TINYINT},
+ </if>
+ <if test="expiredate != null" >
+ expiredate = #{expiredate,jdbcType=TIMESTAMP},
+ </if>
+ <if test="isdel != null" >
+ isdel = #{isdel,jdbcType=TINYINT},
+ </if>
+ <if test="issale != null" >
+ issale = #{issale,jdbcType=TINYINT},
+ </if>
+ <if test="type != null">
+ type = #{type,jdbcType=INTEGER},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.UserInfo" >
+ <!-- -->
+ update user
+ set username = #{username,jdbcType=VARCHAR},
+ password = #{password,jdbcType=VARCHAR},
+ email = #{email,jdbcType=VARCHAR},
+ phone = #{phone,jdbcType=VARCHAR},
+ mobile = #{mobile,jdbcType=VARCHAR},
+ company = #{company,jdbcType=VARCHAR},
+ department = #{department,jdbcType=VARCHAR},
+ job = #{job,jdbcType=VARCHAR},
+ createdby = #{createdby,jdbcType=VARCHAR},
+ createddate = #{createddate,jdbcType=TIMESTAMP},
+ lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR},
+ lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP},
+ province = #{province,jdbcType=VARCHAR},
+ city = #{city,jdbcType=VARCHAR},
+ area = #{area,jdbcType=VARCHAR},
+ town = #{town,jdbcType=VARCHAR},
+ community = #{community,jdbcType=VARCHAR},
+ companyid = #{companyid,jdbcType=BIGINT},
+ status = #{status,jdbcType=TINYINT},
+ expiredate = #{expiredate,jdbcType=TIMESTAMP},
+ isdel = #{isdel,jdbcType=TINYINT},
+ issale = #{issale,jdbcType=TINYINT},
+ type = #{type,jdbcType=INTEGER}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateDeadlineByCompanyId">
+ update user
+ set deadline = #{deadline}
+ where companyid = #{companyid}
+ and isdel = 0
+
+ </update>
+ <update id="updateDeadline2NullByComapnyId">
+ update user
+ set deadline = null
+ where companyid = #{companyid}
+ and isdel = 0
+ </update>
+ <select id="selectByLoginname" resultType="com.gk.firework.Domain.Vo.UserVo" parameterType="java.lang.String">
+ select
+ id, username, password, email, phone, mobile, company, department, job,province, city, area, town,
+ community,companyid, status, expiredate, issale,type
+ from user
+ where username = #{username,jdbcType=VARCHAR}
+ and isdel = 0
+ </select>
+ <select id="selectRoleByUser" resultType="com.gk.firework.Config.Oauth2.OauthRole">
+ SELECT
+ ar.id,
+ ar.NAME,
+ ar.code,
+ ar.btnaccess
+ FROM
+ userroles AS aur
+ LEFT JOIN role AS ar ON ar.id = aur.roleid
+ WHERE
+ aur.userid = #{id,jdbcType=INTEGER}
+ </select>
+ <select id="selectUserDataGrid" resultMap="UserVo">
+ select
+ user.id,
+ user.username,
+ user.password,
+ user.email,
+ user.phone,
+ user.mobile,
+ user.company,
+ user.department,
+ user.job,
+ user.province,
+ user.city,
+ user.area,
+ user.town,
+ user.code,
+ user.community,
+ user.companyid,
+ user.status,
+ user.expiredate,
+ user.issale,
+ user.type,
+ user.lastmodifiedby,
+ user.lastmodifieddate,
+ user.companynumber,
+ user.deadline,
+ enterprise.safetysupervision safetysupervision
+ from user as user
+ left join enterprise as enterprise on user.companyid = enterprise.id
+ <where>
+ user.isdel = 0
+ and user.issale = #{record.issale}
+ <if test="record.username != null and record.username !=''">
+ and user.username = #{record.username,jdbcType=VARCHAR}
+ </if>
+ <if test="record.company != null and record.company !=''">
+ and user.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%')
+ </if>
+ <if test="record.department != null and record.department !=''">
+ and user.department like concat ('%',#{record.department,jdbcType=VARCHAR},'%')
+ </if>
+ <if test="record.job != null and record.job !=''">
+ and user.job like concat ('%',#{record.job,jdbcType=VARCHAR},'%')
+ </if>
+ <if test="record.iscompany == 0">
+ and user.companyid is null
+ </if>
+ <if test="record.iscompany == 1">
+ and user.companyid is not null
+ </if>
+ <if test="record.type != 1">
+ and user.type != 1
+ </if>
+ <if test="record.companyid != null">
+ and user.companyid = #{record.companyid}
+ </if>
+ <if test="record.province != null and record.province !=''">
+ and user.province = #{record.province,jdbcType=VARCHAR}
+ </if>
+ <if test="record.city != null and record.city !=''">
+ and user.city = #{record.city,jdbcType=VARCHAR}
+ </if>
+ <if test="record.area != null and record.area !=''">
+ and user.area = #{record.area,jdbcType=VARCHAR}
+ </if>
+ <if test="record.town != null and record.town !=''">
+ and user.town = #{record.town,jdbcType=VARCHAR}
+ </if>
+ <if test="record.community != null and record.community !=''">
+ and user.community = #{record.community,jdbcType=VARCHAR}
+ </if>
+
+ <if test="record.provinceSee != null and record.provinceSee !=''">
+ and user.province = #{record.provinceSee,jdbcType=VARCHAR}
+ </if>
+ <if test="record.citySee != null and record.citySee !=''">
+ and user.city = #{record.citySee,jdbcType=VARCHAR}
+ </if>
+ <if test="record.areaSee != null and record.areaSee !=''">
+ and user.area = #{record.areaSee,jdbcType=VARCHAR}
+ </if>
+ <if test="record.townSee != null and record.townSee !=''">
+ and user.town = #{record.townSee,jdbcType=VARCHAR}
+ </if>
+ <if test="record.communitySee != null and record.communitySee !=''">
+ and user.community = #{record.communitySee,jdbcType=VARCHAR}
+ </if>
+ <if test="record.safetysupervision != null and record.safetysupervision !=''">
+ and enterprise.safetysupervision = #{record.safetysupervision}
+ </if>
+
+ </where>
+ </select>
+
+ <select id="selectAuth" resultType="com.gk.firework.Domain.AuthorizationInfo">
+ select *
+ from authorization
+ where enterprisenumber = #{companynumber}
+ </select>
+
+ <select id="selectUserInfo" resultType="com.gk.firework.Domain.UserInfo">
+ select *
+ from user
+ <where>
+ 1=1
+ and isdel = 0
+ <if test="id != null">
+ and id != #{id}
+ </if>
+ <if test="username != null and username !=''">
+ and username = #{username}
+ </if>
+ </where>
+ </select>
+ <select id="getOneByCompanyId" resultType="com.gk.firework.Domain.UserInfo" parameterType="java.lang.Long">
+ select *
+ from user
+ where isdel = 0
+ and companyid = #{companyId}
+ </select>
+ <select id="selectSupervise" resultType="com.gk.firework.Domain.UserInfo">
+ select *
+ from user
+ <where>
+ isdel = 0
+ and companyid is null
+ and status is null
+ and issale = 0
+ <if test="province != null and province != ''">
+ and province = #{province}
+ </if>
+ <if test="city != null and city != ''">
+ and city = #{city}
+ </if>
+ <if test="area != null and area !=''">
+ and area = #{area}
+ </if>
+ <if test="town != null and town !=''">
+ and town = #{town}
+ </if>
+ <if test="community != null and community !=''">
+ and community = #{community}
+ </if>
+ </where>
+ limit 1
+ </select>
+ <select id="selectUserVoByName" resultType="com.gk.firework.Domain.Vo.UserVo">
+ select
+ `user`. id,
+ `user`.username,
+ `user`.`password`,
+ `user`.email,
+ `user`.phone,
+ `user`.mobile,
+ `user`.company,
+ `user`.department,
+ `user`.job,
+ `user`.province,
+ `user`.city,
+ `user`.area,
+ `user`.town,
+ `user`.community,
+ `user`.companyid,
+ `user`.`status`,
+ `user`.expiredate,
+ `user`.issale,
+ `user`.`type`,
+ `user`.companynumber,
+ `user`.deadline,
+ enterprise.safetysupervision as roleType
+ from `user`
+ left join enterprise on enterprise.enterprisenumber = `user`.companynumber
+ where username = #{username,jdbcType=VARCHAR}
+ and isdel = 0
+ </select>
+</mapper>
--
Gitblit v1.9.2