首页信息查询接口 增加根据类型查询条件
This commit is contained in:
@ -23,22 +23,30 @@
|
||||
FROM biz_message
|
||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||
WHERE authorize = 0
|
||||
<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>
|
||||
<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
|
||||
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>
|
||||
<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>
|
||||
|
||||
ORDER BY createtime DESC
|
||||
</select>
|
||||
|
||||
|
@ -12,6 +12,4 @@ public class BizMessageVo extends BizMessage{
|
||||
private String userId;
|
||||
private Long datanum;
|
||||
private Integer size;
|
||||
|
||||
private List<String> templatecodes;
|
||||
}
|
||||
|
Reference in New Issue
Block a user