首页信息查询接口 增加根据类型查询条件
This commit is contained in:
@ -23,22 +23,30 @@
|
|||||||
FROM biz_message
|
FROM biz_message
|
||||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||||
WHERE authorize = 0
|
WHERE authorize = 0
|
||||||
<if test="userId!=null and userId!=''">
|
|
||||||
UNION ALL
|
|
||||||
SELECT a.*,IFNULL(b.state,1) as authorizestate
|
|
||||||
FROM ( SELECT biz_message.*,biz_message_template.type as templatetype
|
|
||||||
FROM biz_message
|
|
||||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
|
||||||
WHERE authorize = 1) a
|
|
||||||
INNER JOIN
|
|
||||||
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
|
||||||
</if>
|
|
||||||
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
||||||
and biz_message.templatecode in
|
and biz_message.templatecode in
|
||||||
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
||||||
#{item, jdbcType=NUMERIC}
|
#{item, jdbcType=NUMERIC}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="userId!=null and userId!=''">
|
||||||
|
UNION ALL
|
||||||
|
SELECT a.*,IFNULL(b.state,1) as authorizestate
|
||||||
|
FROM ( SELECT biz_message.*,biz_message_template.type as templatetype
|
||||||
|
FROM biz_message
|
||||||
|
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||||
|
WHERE authorize = 1
|
||||||
|
<if test="templatecodes!=null and templatecodes.size()>0 ">
|
||||||
|
and biz_message.templatecode in
|
||||||
|
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
|
||||||
|
#{item, jdbcType=NUMERIC}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
) a
|
||||||
|
INNER JOIN
|
||||||
|
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
||||||
|
</if>
|
||||||
|
|
||||||
ORDER BY createtime DESC
|
ORDER BY createtime DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -12,6 +12,4 @@ public class BizMessageVo extends BizMessage{
|
|||||||
private String userId;
|
private String userId;
|
||||||
private Long datanum;
|
private Long datanum;
|
||||||
private Integer size;
|
private Integer size;
|
||||||
|
|
||||||
private List<String> templatecodes;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user