完成刷卡列表接口(提交部分)
This commit is contained in:
parent
222181e656
commit
69cf2dd3e6
@ -22,7 +22,7 @@ public class CardList {
|
||||
* totalItems
|
||||
*/
|
||||
@JsonProperty("totalItems")
|
||||
private Integer totalItems;
|
||||
private Long totalItems;
|
||||
/**
|
||||
* data
|
||||
*/
|
||||
@ -59,7 +59,7 @@ public class CardList {
|
||||
private Integer classification;
|
||||
/**
|
||||
* cardStatus
|
||||
* 0 means bound,1 means no bind
|
||||
* 0 means no bound,1 means bind
|
||||
*/
|
||||
@JsonProperty("cardStatus")
|
||||
private Integer cardStatus;
|
||||
@ -75,13 +75,16 @@ public class CardList {
|
||||
* 10 means offline user
|
||||
*/
|
||||
@JsonProperty("userType")
|
||||
private Integer userType;
|
||||
private Long userType;
|
||||
/**
|
||||
* userAccount
|
||||
*/
|
||||
@JsonProperty("userAccount")
|
||||
private String userAccount;
|
||||
|
||||
@JsonProperty("cardRecordId")
|
||||
private Integer cardRecordId;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -30,44 +30,51 @@ public class QueryConditions {
|
||||
@JsonProperty("items")
|
||||
private Long items;
|
||||
/**
|
||||
* cardSerialNumber
|
||||
* 卡号,序列号,模糊查询
|
||||
*/
|
||||
@JsonProperty("cardSerialNumber")
|
||||
private Integer cardSerialNumber;
|
||||
@JsonProperty("cardNumber")
|
||||
private String cardNumber;
|
||||
/**
|
||||
* cardPhysicalNumber
|
||||
*/
|
||||
@JsonProperty("cardPhysicalNumber")
|
||||
private String cardPhysicalNumber;
|
||||
/**
|
||||
* grantOperator
|
||||
* grantOperatorName
|
||||
*/
|
||||
@JsonProperty("grantOperator")
|
||||
private String grantOperator;
|
||||
/**
|
||||
* classification
|
||||
* 0 means offline,1 means online
|
||||
*/
|
||||
@JsonProperty("classification")
|
||||
private Integer classification;
|
||||
/**
|
||||
* cardStatus
|
||||
* 0 means no bound,1 means bind
|
||||
*/
|
||||
@JsonProperty("cardStatus")
|
||||
private Integer cardStatus;
|
||||
/**
|
||||
* cardType
|
||||
* 0 means platform,1 means operator
|
||||
*/
|
||||
@JsonProperty("cardType")
|
||||
private Integer cardType;
|
||||
/**
|
||||
* userType
|
||||
* 0 C端用户 1 流量方用户 2社区用户 3B端用户)
|
||||
* 10 means offline user
|
||||
*/
|
||||
@JsonProperty("userType")
|
||||
private Integer userType;
|
||||
/**
|
||||
* userAccount
|
||||
* 登录用户id
|
||||
*/
|
||||
@JsonProperty("userAccount")
|
||||
private String userAccount;
|
||||
private Long loginUserId;
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
/**
|
||||
* 授权运营商id(平台会有多个)
|
||||
*/
|
||||
private Object grantOperatorIds;
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xhpc.card.domain.QueryConditions;
|
||||
import com.xhpc.card.pojo.TIccardInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TIccardInfoMapper {
|
||||
|
||||
@ -38,6 +39,15 @@ public interface TIccardInfoMapper {
|
||||
* @date 2022/1/27 11:21
|
||||
* @since version-1.0
|
||||
*/
|
||||
List<TIccardInfo> selectAllBy(QueryConditions queryConditions);
|
||||
List<Map<String, Object>> selectAllBy(QueryConditions queryConditions);
|
||||
|
||||
/**
|
||||
* 获取通过条件查询出来的总记录个数
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/2/11 16:15
|
||||
* @since version-1.0
|
||||
*/
|
||||
Long selectTotalCountBy(QueryConditions queryConditions);
|
||||
|
||||
}
|
||||
@ -82,7 +82,9 @@ public class XhpcIcCardInfo implements Serializable {
|
||||
* 逻辑删除字段(默认为0,1为删除)
|
||||
*/
|
||||
private Long delFlag;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -32,29 +32,120 @@
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_iccard_info
|
||||
</select>
|
||||
<select id="selectAllBy" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_iccard_info
|
||||
<select id="selectAllBy" resultType="Map">
|
||||
SELECT
|
||||
t_card.id,
|
||||
t_card.cardID,
|
||||
t_card.cardNo,
|
||||
t_card.cardType,
|
||||
t_card.is_platform,
|
||||
t_card.userIndex,
|
||||
t_card.corpNo,
|
||||
t_card.`status`,
|
||||
op.`name`,
|
||||
xhpc_card.ic_card_info_id,
|
||||
xhpc_card.t_iccard_info_id,
|
||||
xhpc_card.use_status,
|
||||
xhpc_card.user_account,
|
||||
xhpc_card.user_type
|
||||
FROM
|
||||
t_iccard_info t_card
|
||||
LEFT JOIN xhpc_operator op ON t_card.corpNo = op.operator_id
|
||||
LEFT JOIN xhpc_ic_card_info xhpc_card ON t_card.id = xhpc_card.t_iccard_info_id
|
||||
AND xhpc_card.del_flag = 0
|
||||
<where>
|
||||
<if test="cardSerialNumber != null and cardSerialNumber != '' ">
|
||||
and cardId = #{cardSerialNumber},
|
||||
<!-- 只查询指定租户id下的被初始化了的卡 -->
|
||||
t_card.tenant_id = #{tenantId}
|
||||
<!-- 登录运营商的id,只查询该运营商下面的被初始化了的卡 -->
|
||||
<if test="loginUserId!=null">
|
||||
and t_card.corpNo = #{loginUserId}
|
||||
</if>
|
||||
<if test="cardPhysicalNumber != null cardPhysicalNumber !='' ">
|
||||
and cardNo = #{cardPhysicalNumber},
|
||||
<!-- 授权运营商id -->
|
||||
<if test="grantOperatorIds!=null and grantOperatorIds!=''">
|
||||
and t_card.corpNo in
|
||||
<foreach collection="grantOperatorIds" open="(" close=")" item="operatorId" separator=",">
|
||||
#{operatorId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="grantOperator != null">
|
||||
and cardID = #{grantOperator},
|
||||
<!-- 卡类型,只查询指定卡类型的卡 -->
|
||||
<if test="cardType!=null">
|
||||
and t_card.cardType = #{cardType}
|
||||
</if>
|
||||
<if test="cardSerialNumber != null">
|
||||
and cardID = #{cardSerialNumber},
|
||||
<!-- 卡状态 -->
|
||||
<if test="cardStatus!=null">
|
||||
and t_card.status = #{cardStatus}
|
||||
</if>
|
||||
<if test="userindex != null">
|
||||
userIndex,
|
||||
<!-- 卡分类 -->
|
||||
<if test="classification!=null">
|
||||
and t_card.is_platform = #{classification}
|
||||
</if>
|
||||
<!--模糊查询卡序列号或卡编号-->
|
||||
<if test="cardNumber!=null and cardNumber!=''">
|
||||
AND (t_card.cardID LIKE concat('%',#{cardNumber},'%')
|
||||
OR t_card.cardNo LIKE concat('%',#{cardNumber},'%'))
|
||||
</if>
|
||||
<!--用户类型查询-->
|
||||
<if test="userType!=null">
|
||||
<if test="userType==10">
|
||||
and t_card.cardType = 0
|
||||
</if>
|
||||
<if test="userType!=10">
|
||||
and xhpc_card.user_type = #{userType}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
limit #{currentPage},#{items}
|
||||
</select>
|
||||
<select id="selectTotalCountBy" resultType="java.lang.Long">
|
||||
SELECT
|
||||
count(t_card.id)
|
||||
FROM
|
||||
t_iccard_info t_card
|
||||
LEFT JOIN xhpc_operator op ON t_card.corpNo = op.operator_id
|
||||
LEFT JOIN xhpc_ic_card_info xhpc_card ON t_card.id = xhpc_card.t_iccard_info_id
|
||||
AND xhpc_card.del_flag = 0
|
||||
<where>
|
||||
<!-- 只查询指定租户id下的被初始化了的卡 -->
|
||||
t_card.tenant_id = #{tenantId}
|
||||
<!-- 登录运营商的id,只查询该运营商下面的被初始化了的卡 -->
|
||||
<if test="loginUserId!=null">
|
||||
and t_card.corpNo = #{loginUserId}
|
||||
</if>
|
||||
<!-- 授权运营商id -->
|
||||
<if test="grantOperatorIds!=null and grantOperatorIds!=''">
|
||||
and t_card.corpNo in
|
||||
<foreach collection="grantOperatorIds" open="(" close=")" item="operatorId" separator=",">
|
||||
#{operatorId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 卡类型,只查询指定卡类型的卡 -->
|
||||
<if test="cardType!=null">
|
||||
and t_card.cardType = #{cardType}
|
||||
</if>
|
||||
<!-- 卡状态 -->
|
||||
<if test="cardStatus!=null">
|
||||
and t_card.status = #{cardStatus}
|
||||
</if>
|
||||
<!-- 卡分类 -->
|
||||
<if test="classification!=null">
|
||||
and t_card.is_platform = #{classification}
|
||||
</if>
|
||||
<!--模糊查询卡序列号或卡编号-->
|
||||
<if test="cardNumber!=null and cardNumber!=''">
|
||||
AND (t_card.cardID LIKE concat('%',#{cardNumber},'%')
|
||||
OR t_card.cardNo LIKE concat('%',#{cardNumber},'%'))
|
||||
</if>
|
||||
<!--用户类型查询-->
|
||||
<if test="userType!=null">
|
||||
<if test="userType==10">
|
||||
and t_card.cardType = 0
|
||||
</if>
|
||||
<if test="userType!=10">
|
||||
and xhpc_card.user_type = #{userType}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete
|
||||
from t_iccard_info
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user