jiangqs
2023-06-18 c00d0d3bc399b6648145dfd955cedbea90f5f99d
ruoyi-modules/ruoyi-system/src/main/resources/mapper/config/RecommendCooperationMapper.xml
@@ -17,4 +17,41 @@
        ORDER BY create_time DESC
    </select>
    <select id="pageAllotRecommend" resultType="com.ruoyi.system.domain.vo.MgtAllotRecommendPageVo">
        SELECT
            trc.id id,
            trc.recommended_name recommendedName,
            trc.recommended_phone recommendedPhone,
            su.nike_name recommendUserName,
            trc.member_source memberSource,
            trc.create_time createTime
        FROM t_recommend_cooperation trc
        LEFT JOIN sys_user su ON su.user_id = trc.recommend_user_id
        WHERE del_flag = 0
        <if test="param.keyword != null and param.keyword != ''">
            AND (trc.recommended_name LIKE CONCAT('%',#{param.keyword},'%') OR trc.recommended_phone LIKE CONCAT('%',#{param.keyword},'%') OR su.nike_name LIKE CONCAT('%',#{param.keyword},'%'))
        </if>
        <if test="param.memberSource != null and param.memberSource != ''">
            AND FIND_IN_SET(#{param.memberSource},trc.member_source) &gt; 0
        </if>
        <if test="param.createStartTime!=null and param.createStartTime!=''">
            AND trc.create_time &gt;= #{param.createStartTime}
        </if>
        <if test="param.createEndTime!=null and param.createEndTime!=''">
            AND trc.create_time &lt;= #{param.createEndTime}
        </if>
        ORDER BY trc.create_time DESC
    </select>
    <update id="allotRecommend">
        UPDATE t_recommend_cooperation set allot_user_id = #{param.allotUserId} WHERE id IN (#{param.recommendIds})
    </update>
    <select id="customTotal" resultType="java.lang.Integer">
        SELECT COUNT(id) FROM t_recommend_cooperation WHERE del_flag = 0
    </select>
    <select id="customToday" resultType="java.lang.Integer">
        SELECT COUNT(id) FROM t_recommend_cooperation WHERE del_flag = 0 AND create_time = CURDATE()
    </select>
</mapper>