提交 9500ece9 作者: 沈振路

获客链接配置表的映射mapper

上级 d345be49
package com.yaoyaozw.customer.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.data.annotation.Id;
import java.io.Serializable;
import java.util.Date;
@Data
public class CompanyAcquisitionLink implements Serializable {
/**
* 主键Id
*/
@Id
@TableId(value = "id", type = IdType.AUTO)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 公众号AppID
*/
private String authAppId;
/**
* 企业Id
*/
private Long companyId;
/**
* 链接Id
*/
private String linkId;
/**
* 链接名称
*/
private String linkName;
/**
* 链接地址
*/
private String linkUrl;
/**
* 链接创建时间
*/
private Date createTime;
/**
* 是否无需验证
*/
private Integer skipVerify;
/**
* 链接绑定用户列表Json
*/
private String userListJson;
/**
* OPERATE:运营;PUTTING:投放
*/
private String type;
/**
* 状态
*/
private Integer status;
@TableLogic
private Integer isDeleted;
/**
*
*/
@TableField(value = "gmt_create", fill = FieldFill.INSERT)
private Date gmtCreate;
/**
*
*/
@TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yaoyaozw.customer.mapper;
import com.yaoyaozw.customer.entity.AuthorizerInfo;
import com.yaoyaozw.customer.entity.CompanyAcquisitionLink;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface CompanyAcquisitionLinkMapper {
/**
* 根据链接Id获取获客链接信息
* @param linkId 链接Id
* @return 获客链接信息
*/
CompanyAcquisitionLink getAcquisitionInfoByLinkId(@Param("linkId") String linkId);
/**
* 获取指定appId的获客链接列表
* @param appId appId
* @param exceptLinkId 排除的链接Id
* @return 可使用链接列表
*/
List<CompanyAcquisitionLink> getAvailableAcquisitionListExceptLinkId(@Param("appId") String appId, @Param("exceptLinkId") String exceptLinkId);
}
<?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.yaoyaozw.customer.mapper.CompanyAcquisitionLinkMapper">
<select id="getAcquisitionInfoByLinkId" resultType="CompanyAcquisitionLink">
select * from company_acquisition_link where link_id = #{linkId} and is_deleted = 0
</select>
<select id="getAvailableAcquisitionListExceptLinkId"
resultType="com.yaoyaozw.customer.entity.CompanyAcquisitionLink">
select * from company_acquisition_link where is_deleted = 0 and `status` = 1 and auth_app_id = #{appId}
<if test="exceptLinkId != null and exceptLinkId != ''">
and link_id != #{exceptLinkId}
</if>
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论