完成刷卡列表接口(提交部分)

This commit is contained in:
wen 2022-02-11 16:32:58 +08:00
parent 222181e656
commit 69cf2dd3e6
5 changed files with 144 additions and 31 deletions

View File

@ -22,7 +22,7 @@ public class CardList {
* totalItems * totalItems
*/ */
@JsonProperty("totalItems") @JsonProperty("totalItems")
private Integer totalItems; private Long totalItems;
/** /**
* data * data
*/ */
@ -59,7 +59,7 @@ public class CardList {
private Integer classification; private Integer classification;
/** /**
* cardStatus * cardStatus
* 0 means bound,1 means no bind * 0 means no bound,1 means bind
*/ */
@JsonProperty("cardStatus") @JsonProperty("cardStatus")
private Integer cardStatus; private Integer cardStatus;
@ -75,13 +75,16 @@ public class CardList {
* 10 means offline user * 10 means offline user
*/ */
@JsonProperty("userType") @JsonProperty("userType")
private Integer userType; private Long userType;
/** /**
* userAccount * userAccount
*/ */
@JsonProperty("userAccount") @JsonProperty("userAccount")
private String userAccount; private String userAccount;
@JsonProperty("cardRecordId")
private Integer cardRecordId;
} }
} }

View File

@ -30,44 +30,51 @@ public class QueryConditions {
@JsonProperty("items") @JsonProperty("items")
private Long items; private Long items;
/** /**
* cardSerialNumber * 卡号序列号模糊查询
*/ */
@JsonProperty("cardSerialNumber") @JsonProperty("cardNumber")
private Integer cardSerialNumber; private String cardNumber;
/** /**
* cardPhysicalNumber * grantOperatorName
*/
@JsonProperty("cardPhysicalNumber")
private String cardPhysicalNumber;
/**
* grantOperator
*/ */
@JsonProperty("grantOperator") @JsonProperty("grantOperator")
private String grantOperator; private String grantOperator;
/** /**
* classification * classification
* 0 means offline,1 means online
*/ */
@JsonProperty("classification") @JsonProperty("classification")
private Integer classification; private Integer classification;
/** /**
* cardStatus * cardStatus
* 0 means no bound,1 means bind
*/ */
@JsonProperty("cardStatus") @JsonProperty("cardStatus")
private Integer cardStatus; private Integer cardStatus;
/** /**
* cardType * cardType
* 0 means platform,1 means operator
*/ */
@JsonProperty("cardType") @JsonProperty("cardType")
private Integer cardType; private Integer cardType;
/** /**
* userType * userType
* 0 C端用户 1 流量方用户 2社区用户 3B端用户
* 10 means offline user
*/ */
@JsonProperty("userType") @JsonProperty("userType")
private Integer userType; private Integer userType;
/** /**
* userAccount * 登录用户id
*/ */
@JsonProperty("userAccount") private Long loginUserId;
private String userAccount; /**
* 租户id
*/
private String tenantId;
/**
* 授权运营商id(平台会有多个)
*/
private Object grantOperatorIds;
} }

View File

@ -4,6 +4,7 @@ import com.xhpc.card.domain.QueryConditions;
import com.xhpc.card.pojo.TIccardInfo; import com.xhpc.card.pojo.TIccardInfo;
import java.util.List; import java.util.List;
import java.util.Map;
public interface TIccardInfoMapper { public interface TIccardInfoMapper {
@ -38,6 +39,15 @@ public interface TIccardInfoMapper {
* @date 2022/1/27 11:21 * @date 2022/1/27 11:21
* @since version-1.0 * @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);
} }

View File

@ -82,7 +82,9 @@ public class XhpcIcCardInfo implements Serializable {
* 逻辑删除字段默认为01为删除 * 逻辑删除字段默认为01为删除
*/ */
private Long delFlag; private Long delFlag;
/**
* 租户id
*/
private String tenantId; private String tenantId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -32,29 +32,120 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from t_iccard_info from t_iccard_info
</select> </select>
<select id="selectAllBy" resultMap="BaseResultMap"> <select id="selectAllBy" resultType="Map">
select SELECT
<include refid="Base_Column_List"/> t_card.id,
from t_iccard_info 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> <where>
<if test="cardSerialNumber != null and cardSerialNumber != '' "> <!-- 只查询指定租户id下的被初始化了的卡 -->
and cardId = #{cardSerialNumber}, t_card.tenant_id = #{tenantId}
<!-- 登录运营商的id只查询该运营商下面的被初始化了的卡 -->
<if test="loginUserId!=null">
and t_card.corpNo = #{loginUserId}
</if> </if>
<if test="cardPhysicalNumber != null cardPhysicalNumber !='' "> <!-- 授权运营商id -->
and cardNo = #{cardPhysicalNumber}, <if test="grantOperatorIds!=null and grantOperatorIds!=''">
and t_card.corpNo in
<foreach collection="grantOperatorIds" open="(" close=")" item="operatorId" separator=",">
#{operatorId}
</foreach>
</if> </if>
<if test="grantOperator != null"> <!-- 卡类型,只查询指定卡类型的卡 -->
and cardID = #{grantOperator}, <if test="cardType!=null">
and t_card.cardType = #{cardType}
</if> </if>
<if test="cardSerialNumber != null"> <!-- 卡状态 -->
and cardID = #{cardSerialNumber}, <if test="cardStatus!=null">
and t_card.status = #{cardStatus}
</if> </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> </if>
</where> </where>
limit #{currentPage},#{items} limit #{currentPage},#{items}
</select> </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 id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete delete
from t_iccard_info from t_iccard_info