|
|
@@ -11,18 +11,18 @@
|
|
|
<result column="state" property="state" typeHandler="com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <resultMap id="UserLoginLogResultMap" type="com.zhiqiyun.open.core.models.UserLoginLog">
|
|
|
- <id column="id" property="id" jdbcType="BIGINT"/>
|
|
|
- <result column="login_account" property="loginAccount" jdbcType="VARCHAR"/>
|
|
|
- <result column="account_type" property="accountType"
|
|
|
- typeHandler="com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler"/>
|
|
|
- <result column="login_ip" property="loginIp" jdbcType="VARCHAR"/>
|
|
|
- <result column="login_local" property="loginLocal" jdbcType="VARCHAR"/>
|
|
|
- <result column="from_source" property="fromSource" jdbcType="VARCHAR"/>
|
|
|
- <result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
|
|
|
- <result column="login_time" property="loginTime" jdbcType="TIMESTAMP"/>
|
|
|
- <result column="state" property="state" typeHandler="com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler"/>
|
|
|
- </resultMap>
|
|
|
+<!-- <resultMap id="UserLoginLogResultMap" type="com.zhiqiyun.open.core.models.UserLoginLog">-->
|
|
|
+<!-- <id column="id" property="id" jdbcType="BIGINT"/>-->
|
|
|
+<!-- <result column="login_account" property="loginAccount" jdbcType="VARCHAR"/>-->
|
|
|
+<!-- <result column="account_type" property="accountType"-->
|
|
|
+<!-- typeHandler="com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler"/>-->
|
|
|
+<!-- <result column="login_ip" property="loginIp" jdbcType="VARCHAR"/>-->
|
|
|
+<!-- <result column="login_local" property="loginLocal" jdbcType="VARCHAR"/>-->
|
|
|
+<!-- <result column="from_source" property="fromSource" jdbcType="VARCHAR"/>-->
|
|
|
+<!-- <result column="device_id" property="deviceId" jdbcType="VARCHAR"/>-->
|
|
|
+<!-- <result column="login_time" property="loginTime" jdbcType="TIMESTAMP"/>-->
|
|
|
+<!-- <result column="state" property="state" typeHandler="com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler"/>-->
|
|
|
+<!-- </resultMap>-->
|
|
|
<resultMap id="UserOperateLogResultMap" type="com.zhiqiyun.open.core.models.UserOperateLog">
|
|
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
|
|
<result column="uid" property="uid" jdbcType="BIGINT"/>
|
|
|
@@ -104,32 +104,18 @@
|
|
|
#{registerTime, jdbcType=TIMESTAMP},
|
|
|
#{registerIp, jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
- <insert id="insertOperateLog" parameterType="com.zhiqiyun.open.core.models.UserOperateLog">
|
|
|
- insert into `user_operate_logs` (`id`, `uid`, `tags`, `from_source`, `request_url`, `request_ip`,
|
|
|
- `request_params`, `request_data`, `request_time`, `response_time`)
|
|
|
- values (#{id, jdbcType=VARCHAR},
|
|
|
- #{uid, jdbcType=BIGINT},
|
|
|
- #{tags, jdbcType=VARCHAR},
|
|
|
- #{fromSource, jdbcType=VARCHAR},
|
|
|
- #{requestUrl, jdbcType=VARCHAR},
|
|
|
- #{requestIp, jdbcType=VARCHAR},
|
|
|
- #{requestParams, jdbcType=VARCHAR},
|
|
|
- #{requestData, jdbcType=VARCHAR},
|
|
|
- #{requestTime, jdbcType=TIMESTAMP},
|
|
|
- #{responseTime, jdbcType=TIMESTAMP})
|
|
|
- </insert>
|
|
|
- <insert id="insertLoginLog">
|
|
|
- insert into `user_login_logs` (`login_account`, `account_type`, `login_ip`, `login_local`, `from_source`,
|
|
|
- `device_id`, `login_time`, `state`)
|
|
|
- values (#{loginAccount},
|
|
|
- #{accountType, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler},
|
|
|
- #{loginIp},
|
|
|
- #{loginLocal},
|
|
|
- #{fromSource},
|
|
|
- #{deviceId},
|
|
|
- #{loginTime, jdbcType=TIMESTAMP},
|
|
|
- #{state, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler})
|
|
|
- </insert>
|
|
|
+<!-- <insert id="insertLoginLog">-->
|
|
|
+<!-- insert into `user_login_logs` (`login_account`, `account_type`, `login_ip`, `login_local`, `from_source`,-->
|
|
|
+<!-- `device_id`, `login_time`, `state`)-->
|
|
|
+<!-- values (#{loginAccount},-->
|
|
|
+<!-- #{accountType, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler},-->
|
|
|
+<!-- #{loginIp},-->
|
|
|
+<!-- #{loginLocal},-->
|
|
|
+<!-- #{fromSource},-->
|
|
|
+<!-- #{deviceId},-->
|
|
|
+<!-- #{loginTime, jdbcType=TIMESTAMP},-->
|
|
|
+<!-- #{state, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler})-->
|
|
|
+<!-- </insert>-->
|
|
|
<update id="updateById" parameterType="com.zhiqiyun.open.core.models.UserBaseInfo">
|
|
|
update `user_base_info`
|
|
|
<set>
|
|
|
@@ -161,77 +147,45 @@
|
|
|
)
|
|
|
)
|
|
|
</select>
|
|
|
- <select id="findRoles" resultMap="com.zhiqiyun.open.core.mapper.RoleInfoMapper.BaseResultMap"
|
|
|
- parameterType="java.lang.Long">
|
|
|
- select
|
|
|
- <include refid="com.zhiqiyun.open.core.mapper.RoleInfoMapper.Base_Column"/>
|
|
|
- from `role_info`
|
|
|
- <where>
|
|
|
- `id` in (select `role_id` from `user_role` where `uid` = #{uid,jdbcType=BIGINT})
|
|
|
- </where>
|
|
|
- </select>
|
|
|
- <select id="findLoginLogPage" resultMap="UserLoginLogResultMap">
|
|
|
- select
|
|
|
- `id`, `login_account`, `account_type`, `login_ip`, `login_local`, `from_source`, `device_id`,
|
|
|
- `login_time`, `state`
|
|
|
- from user_login_logs a
|
|
|
- <where>
|
|
|
- <if test="loginAccount !=null and loginAccount !=''">
|
|
|
- AND `login_account` like CONCAT('%',#{loginAccount},'%')
|
|
|
- </if>
|
|
|
- <if test="accountType !=null">
|
|
|
- AND `account_type`=#{accountType, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="loginIp !=null and loginIp !=''">
|
|
|
- AND `login_ip`=#{loginIp}
|
|
|
- </if>
|
|
|
- <if test="loginLocal !=null and loginLocal !=''">
|
|
|
- AND `login_local` like CONCAT('%',#{loginLocal},'%')
|
|
|
- </if>
|
|
|
- <if test="fromSource !=null and fromSource !=''">
|
|
|
- AND `from_source` like CONCAT('%',#{fromSource},'%')
|
|
|
- </if>
|
|
|
- <if test="loginTime !=null">
|
|
|
- AND `login_time` between #{loginTime.statDate, jdbcType=TIMESTAMP} and
|
|
|
- #{loginTime.endDate, jdbcType=TIMESTAMP}
|
|
|
- </if>
|
|
|
- <if test="state !=null">
|
|
|
- AND `state` = #{state, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findOperateLogPage" resultMap="UserOperateLogResultMap">
|
|
|
- select
|
|
|
- a.id,a.uid,a.tags,a.from_source,a.request_ip,a.request_url,a.request_params,a.request_data,a.request_time,a.response_time,
|
|
|
- b.nick_name
|
|
|
- from user_operate_logs a
|
|
|
- left join user_base_info b on a.`uid`=b.`id`
|
|
|
- <where>
|
|
|
- <if test="nickName !=null and nickName !=''">
|
|
|
- AND b.`nick_name` like CONCAT("%",#{nickName},"%")
|
|
|
- </if>
|
|
|
- <if test="tags !=null and tags !=''">
|
|
|
- AND a.`tags` like CONCAT("%",#{tags},"%")
|
|
|
- </if>
|
|
|
- <if test="requestIp !=null and requestIp !=''">
|
|
|
- AND a.`request_ip` = #{requestIp}
|
|
|
- </if>
|
|
|
- <if test="requestUrl !=null and requestUrl !=''">
|
|
|
- AND a.`request_url` like CONCAT("%",#{requestUrl},"%")
|
|
|
- </if>
|
|
|
- <if test="requestParams !=null and requestParams !=''">
|
|
|
- AND a.`request_params` like CONCAT("%",#{requestParams},"%")
|
|
|
- </if>
|
|
|
- <if test="requestData !=null and requestData !=''">
|
|
|
- AND a.`request_data` like CONCAT("%",#{requestData},"%")
|
|
|
- </if>
|
|
|
- <if test="requestTime !=null">
|
|
|
- AND `request_time` between #{requestTime.statDate, jdbcType=TIMESTAMP} and
|
|
|
- #{requestTime.endDate, jdbcType=TIMESTAMP}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+<!-- <select id="findRoles" resultMap="com.zhiqiyun.open.core.mapper.RoleInfoMapper.BaseResultMap"-->
|
|
|
+<!-- parameterType="java.lang.Long">-->
|
|
|
+<!-- select-->
|
|
|
+<!-- <include refid="com.zhiqiyun.open.core.mapper.RoleInfoMapper.Base_Column"/>-->
|
|
|
+<!-- from `role_info`-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- `id` in (select `role_id` from `user_role` where `uid` = #{uid,jdbcType=BIGINT})-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- </select>-->
|
|
|
+<!-- <select id="findLoginLogPage" resultMap="UserLoginLogResultMap">-->
|
|
|
+<!-- select-->
|
|
|
+<!-- `id`, `login_account`, `account_type`, `login_ip`, `login_local`, `from_source`, `device_id`,-->
|
|
|
+<!-- `login_time`, `state`-->
|
|
|
+<!-- from user_login_logs a-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- <if test="loginAccount !=null and loginAccount !=''">-->
|
|
|
+<!-- AND `login_account` like CONCAT('%',#{loginAccount},'%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="accountType !=null">-->
|
|
|
+<!-- AND `account_type`=#{accountType, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="loginIp !=null and loginIp !=''">-->
|
|
|
+<!-- AND `login_ip`=#{loginIp}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="loginLocal !=null and loginLocal !=''">-->
|
|
|
+<!-- AND `login_local` like CONCAT('%',#{loginLocal},'%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="fromSource !=null and fromSource !=''">-->
|
|
|
+<!-- AND `from_source` like CONCAT('%',#{fromSource},'%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="loginTime !=null">-->
|
|
|
+<!-- AND `login_time` between #{loginTime.statDate, jdbcType=TIMESTAMP} and-->
|
|
|
+<!-- #{loginTime.endDate, jdbcType=TIMESTAMP}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="state !=null">-->
|
|
|
+<!-- AND `state` = #{state, typeHandler=com.zhiqiyun.open.mybatis.typeHandler.IEnumTypeHandler}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- </select>-->
|
|
|
<select id="findSelectAccounts" resultType="java.util.Map">
|
|
|
select id,`nick_name` as nickName from `user_base_info`
|
|
|
<where>
|