This commit is contained in:
zhangchenbiao
2023-05-23 16:37:25 +08:00
parent 63505941d0
commit 799b6b8cf5
59 changed files with 1994 additions and 76 deletions

View File

@@ -57,4 +57,13 @@
where
db_name = #{dbName} limit 1
</select>
<select id="getConfigByCorpIdAndAppType" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
enterprise_config
where
ding_corp_id = #{corpId} and app_type = #{appType}
</select>
</mapper>

View File

@@ -0,0 +1,295 @@
<?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.cool.store.mapper.EnterpriseMapper">
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseDO">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="original_name" jdbcType="VARCHAR" property="originalName"/>
<result column="mobile" jdbcType="CHAR" property="mobile"/>
<result column="province" jdbcType="VARCHAR" property="province"/>
<result column="city" jdbcType="VARCHAR" property="city"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="logo" jdbcType="VARCHAR" property="logo"/>
<result column="is_vip" jdbcType="INTEGER" property="isVip"/>
<result column="auth_type" jdbcType="INTEGER" property="authType"/>
<result column="auth_user_id" jdbcType="VARCHAR" property="authUserId"/>
<result column="industry" jdbcType="VARCHAR" property="industry"/>
<result column="logo_name" jdbcType="VARCHAR" property="logoName"/>
<result column="corp_logo_url" jdbcType="VARCHAR" property="corpLogoUrl"/>
<result column="is_authenticated" jdbcType="INTEGER" property="isAuthenticated"/>
<result column="auth_level" jdbcType="INTEGER" property="authLevel"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="package_begin_date" jdbcType="TIMESTAMP" property="packageBeginDate"/>
<result column="package_end_date" jdbcType="TIMESTAMP" property="packageEndDate"/>
<result column="aliyun_person_group_crop_id" jdbcType="VARCHAR" property="aliyunPersonGroupCropId"/>
<result column="app_type" jdbcType="VARCHAR" property="appType"/>
<result column="tag" jdbcType="VARCHAR" property="tag"/>
<result column="dataware_config" jdbcType="VARCHAR" property="datawareConfig"/>
<result column="is_leave_info" jdbcType="BIT" property="isLeaveInfo"/>
<result column="limit_store_count" jdbcType="INTEGER" property="limitStoreCount"/>
<result column="limit_device_count" jdbcType="INTEGER" property="limitDeviceCount"/>
</resultMap>
<sql id="Base_Column_List">
id, name, original_name, mobile, province, city, status, logo, is_vip, auth_type,
auth_user_id, industry, logo_name, corp_logo_url, is_authenticated, auth_level, create_time,
update_time, package_begin_date, package_end_date, aliyun_person_group_crop_id, app_type,
tag, dataware_config, is_leave_info, limit_store_count, limit_device_count
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="originalName != null">
original_name,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="status != null">
status,
</if>
<if test="logo != null">
logo,
</if>
<if test="isVip != null">
is_vip,
</if>
<if test="authType != null">
auth_type,
</if>
<if test="authUserId != null">
auth_user_id,
</if>
<if test="industry != null">
industry,
</if>
<if test="logoName != null">
logo_name,
</if>
<if test="corpLogoUrl != null">
corp_logo_url,
</if>
<if test="isAuthenticated != null">
is_authenticated,
</if>
<if test="authLevel != null">
auth_level,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="packageBeginDate != null">
package_begin_date,
</if>
<if test="packageEndDate != null">
package_end_date,
</if>
<if test="aliyunPersonGroupCropId != null">
aliyun_person_group_crop_id,
</if>
<if test="appType != null">
app_type,
</if>
<if test="tag != null">
tag,
</if>
<if test="datawareConfig != null">
dataware_config,
</if>
<if test="isLeaveInfo != null">
is_leave_info,
</if>
<if test="limitStoreCount != null">
limit_store_count,
</if>
<if test="limitDeviceCount != null">
limit_device_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name},
</if>
<if test="originalName != null">
#{originalName},
</if>
<if test="mobile != null">
#{mobile},
</if>
<if test="province != null">
#{province},
</if>
<if test="city != null">
#{city},
</if>
<if test="status != null">
#{status},
</if>
<if test="logo != null">
#{logo},
</if>
<if test="isVip != null">
#{isVip},
</if>
<if test="authType != null">
#{authType},
</if>
<if test="authUserId != null">
#{authUserId},
</if>
<if test="industry != null">
#{industry},
</if>
<if test="logoName != null">
#{logoName},
</if>
<if test="corpLogoUrl != null">
#{corpLogoUrl},
</if>
<if test="isAuthenticated != null">
#{isAuthenticated},
</if>
<if test="authLevel != null">
#{authLevel},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="packageBeginDate != null">
#{packageBeginDate},
</if>
<if test="packageEndDate != null">
#{packageEndDate},
</if>
<if test="aliyunPersonGroupCropId != null">
#{aliyunPersonGroupCropId},
</if>
<if test="appType != null">
#{appType},
</if>
<if test="tag != null">
#{tag},
</if>
<if test="datawareConfig != null">
#{datawareConfig},
</if>
<if test="isLeaveInfo != null">
#{isLeaveInfo},
</if>
<if test="limitStoreCount != null">
#{limitStoreCount},
</if>
<if test="limitDeviceCount != null">
#{limitDeviceCount},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise
<set>
<if test="name != null">
name = #{name},
</if>
<if test="originalName != null">
original_name = #{originalName},
</if>
<if test="mobile != null">
mobile = #{mobile},
</if>
<if test="province != null">
province = #{province},
</if>
<if test="city != null">
city = #{city},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="logo != null">
logo = #{logo},
</if>
<if test="isVip != null">
is_vip = #{isVip},
</if>
<if test="authType != null">
auth_type = #{authType},
</if>
<if test="authUserId != null">
auth_user_id = #{authUserId},
</if>
<if test="industry != null">
industry = #{industry},
</if>
<if test="logoName != null">
logo_name = #{logoName},
</if>
<if test="corpLogoUrl != null">
corp_logo_url = #{corpLogoUrl},
</if>
<if test="isAuthenticated != null">
is_authenticated = #{isAuthenticated},
</if>
<if test="authLevel != null">
auth_level = #{authLevel},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="packageBeginDate != null">
package_begin_date = #{packageBeginDate},
</if>
<if test="packageEndDate != null">
package_end_date = #{packageEndDate},
</if>
<if test="aliyunPersonGroupCropId != null">
aliyun_person_group_crop_id = #{aliyunPersonGroupCropId},
</if>
<if test="appType != null">
app_type = #{appType},
</if>
<if test="tag != null">
tag = #{tag},
</if>
<if test="datawareConfig != null">
dataware_config = #{datawareConfig},
</if>
<if test="isLeaveInfo != null">
is_leave_info = #{isLeaveInfo},
</if>
<if test="limitStoreCount != null">
limit_store_count = #{limitStoreCount},
</if>
<if test="limitDeviceCount != null">
limit_device_count = #{limitDeviceCount},
</if>
</set>
where id = #{id}
</update>
<select id="getEnterpriseById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
enterprise
where
id = #{id}
</select>
</mapper>

View File

@@ -388,4 +388,14 @@
</set>
where id = #{record.id}
</update>
<select id="getUserInfoById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
enterprise_user_${enterpriseId}
where
user_id = #{userId}
</select>
</mapper>

View File

@@ -0,0 +1,43 @@
<?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.cool.store.mapper.LoginRecordMapper">
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.LoginRecordDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
id, user_id, create_time
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into login_record_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update login_record_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
</set>
where id = #{record.id}
</update>
</mapper>

View File

@@ -161,4 +161,23 @@
</set>
where id = #{record.id}
</update>
<select id="getHighestPrioritySysRoleDoByUserId" resultMap="BaseResultMap">
select
c.id as id,
c.role_name as roleName,
c.role_auth as roleAuth,
c.position_type as positionType,
c.app_menu as appMenu,
c.role_enum as roleEnum
from
enterprise_user_${enterpriseId} a
left join enterprise_user_role_${enterpriseId} b on a.user_id =b.user_id
left join sys_role_${enterpriseId} c on c.id=b.role_id
where
a.user_id= #{userId} and a.active = true
order by
c.priority is null, c.priority, position_type desc
LIMIT 1
</select>
</mapper>