|
|
@ -20,14 +20,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectLarkUserActiveRelatoinVo">
|
|
|
|
<sql id="selectLarkUserActiveRelatoinVo">
|
|
|
|
select id, company_id, company_name, user_name, active_id, active_stage, create_by, create_time, update_by, update_time, flag, remark from lark_user_active_relatoin
|
|
|
|
select id,
|
|
|
|
|
|
|
|
company_id,
|
|
|
|
|
|
|
|
company_name,
|
|
|
|
|
|
|
|
user_name,
|
|
|
|
|
|
|
|
active_id,
|
|
|
|
|
|
|
|
active_stage,
|
|
|
|
|
|
|
|
create_by,
|
|
|
|
|
|
|
|
create_time,
|
|
|
|
|
|
|
|
update_by,
|
|
|
|
|
|
|
|
update_time,
|
|
|
|
|
|
|
|
flag,
|
|
|
|
|
|
|
|
remark
|
|
|
|
|
|
|
|
from lark_user_active_relatoin
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectLarkUserActiveRelatoinList" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin" resultMap="LarkUserActiveRelatoinResult">
|
|
|
|
<select id="selectLarkUserActiveRelatoinList" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
|
|
|
|
|
|
|
|
resultMap="LarkUserActiveRelatoinResult">
|
|
|
|
<include refid="selectLarkUserActiveRelatoinVo"/>
|
|
|
|
<include refid="selectLarkUserActiveRelatoinVo"/>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
|
|
|
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
|
|
|
|
|
|
|
|
'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
@ -35,12 +50,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryPage" parameterType="com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest"
|
|
|
|
|
|
|
|
resultMap="LarkUserActiveRelatoinResult">
|
|
|
|
|
|
|
|
<include refid="selectLarkUserActiveRelatoinVo"/>
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
|
|
|
|
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
|
|
|
|
|
|
|
|
'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
|
|
|
|
|
<if test="flag != null ">and flag = #{flag}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
limit #{offset},{pageSize}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="count" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
|
|
|
|
|
|
|
|
resultType="java.lang.Integer">
|
|
|
|
|
|
|
|
select count(id) from lark_user_active_relatoin
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
|
|
|
|
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
|
|
|
|
|
|
|
|
'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
|
|
|
|
|
<if test="flag != null ">and flag = #{flag}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryUserCount" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
|
|
|
|
|
|
|
|
resultType="java.lang.Integer">
|
|
|
|
|
|
|
|
select count(id) from lark_user_active_relatoin
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
|
|
|
|
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
|
|
|
|
|
|
|
|
'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
|
|
|
|
|
<if test="flag != null ">and flag = #{flag}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
group by user_name
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryUserCountGroupByActive" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
|
|
|
|
|
|
|
|
resultMap="com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo">
|
|
|
|
|
|
|
|
select active_id as id ,count(id) as qty from lark_user_active_relatoin
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="companyId != null ">and company_id = #{companyId}</if>
|
|
|
|
|
|
|
|
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
|
|
|
|
|
|
|
|
'%')
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="activeId != null ">and active_id = #{activeId}</if>
|
|
|
|
|
|
|
|
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
|
|
|
|
|
|
|
|
<if test="flag != null ">and flag = #{flag}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
group by active_id
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryCompleteActiveUserName" resultType="java.lang.String">
|
|
|
|
|
|
|
|
select user_name, COUNT(id) as total
|
|
|
|
|
|
|
|
from lark_user_active_relatoin
|
|
|
|
|
|
|
|
where company_name = #{companyName}
|
|
|
|
|
|
|
|
GROUP BY user_name
|
|
|
|
|
|
|
|
HAVING total > #{count}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectLarkUserActiveRelatoinById" parameterType="Long" resultMap="LarkUserActiveRelatoinResult">
|
|
|
|
<select id="selectLarkUserActiveRelatoinById" parameterType="Long" resultMap="LarkUserActiveRelatoinResult">
|
|
|
|
<include refid="selectLarkUserActiveRelatoinVo"/>
|
|
|
|
<include refid="selectLarkUserActiveRelatoinVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertLarkUserActiveRelatoin" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
<insert id="insertLarkUserActiveRelatoin" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
|
|
|
|
|
|
|
|
useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into lark_user_active_relatoin
|
|
|
|
insert into lark_user_active_relatoin
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
@ -89,7 +176,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLarkUserActiveRelatoinById" parameterType="Long">
|
|
|
|
<delete id="deleteLarkUserActiveRelatoinById" parameterType="Long">
|
|
|
|
delete from lark_user_active_relatoin where id = #{id}
|
|
|
|
delete
|
|
|
|
|
|
|
|
from lark_user_active_relatoin
|
|
|
|
|
|
|
|
where id = #{id}
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLarkUserActiveRelatoinByIds" parameterType="String">
|
|
|
|
<delete id="deleteLarkUserActiveRelatoinByIds" parameterType="String">
|
|
|
|