Commit 12a2fbef authored by liwei's avatar liwei

修改了查询话题sql

parent 2b4b49b1
......@@ -78,8 +78,8 @@ public class OpmTopicController extends CyPaginationController<OpmTopic> {
}
// @PreAuthorize("@cyPerm.hasPerm('opm:notice:singleSearch')")
@CyOpeLogAnno(title = "system-公告管理-查询公告", businessType = CyLogTypeEnum.QUERY)
@Operation(summary = "查询单一公告", description = "查询单一公告")
@CyOpeLogAnno(title = "system-话题管理-查询话题", businessType = CyLogTypeEnum.QUERY)
@Operation(summary = "查询单一话题", description = "查询单一话题")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true)})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable Integer businessId) {
......@@ -92,9 +92,8 @@ public class OpmTopicController extends CyPaginationController<OpmTopic> {
//@PreAuthorize("@cyPerm.hasPerm('sys:contentNewsInformation:list')")
@CyOpeLogAnno(title = "system-话题管理-查询话题", businessType = CyLogTypeEnum.QUERY)
@Operation(summary = "查询话题集合", description = "查询话题集合")
@GetMapping(value = "/queryOpmTopic")
public CyResult querySysContentNewsInformations(OpmTopic opmTopic) {
@GetMapping(value = "/queryAllOpmTopic")
public CyResult queryAllTopicList(OpmTopic opmTopic) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
......@@ -153,7 +152,7 @@ public class OpmTopicController extends CyPaginationController<OpmTopic> {
@CyOpeLogAnno(title = "system-话题管理-查询话题", businessType = CyLogTypeEnum.EXPORT)
@Operation(summary = "导出话题信息", description = "导出话题信息")
@GetMapping(value = "/export")
public void outSysContentNewsInformation(HttpServletResponse response, OpmTopic opmTopic, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
public void outTopicInformation(HttpServletResponse response, OpmTopic opmTopic, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName = "";
switch (excelId) {
case "0":
......
......@@ -17,34 +17,49 @@
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryOpmTopic" resultMap="BaseResultMap">
select * from opm_topic
where 1=1
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and create_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and create_date &lt;= #{entity.endTime}
</if>
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and update_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and update_date &lt;= #{entity.endTime}
</if>
<if test="entity.topicName !=null and entity.topicName != '' ">
and topic_name like concat('%',#{entity.topicName},'%')
</if>
SELECT cn.business_id,
cn.create_by,
cn.create_date,
cn.update_by,
cn.del_flag,
cn.flag,
cn.topic_name,
cn.exam_status,
cn.weight,
cn.article_count,
su.nick_name as nickName
FROM opm_topic cn
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
<if test="entity.flag!=null and entity.flag != '' ">
and cn.flag = #{entity.flag}
</if>
<if test="entity.examStatus!=null and entity.examStatus != '' ">
and cn.exam_status = #{entity.examStatus}
</if>
<if test="entity.createBy !=null and entity.createBy != '' ">
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if test="entity.beginTime !=null ">
and cn.create_Date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null ">
and cn.create_Date &lt;= #{entity.endTime}
</if>
<if test="entity.updateBy !=null and entity.updateBy != '' ">
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if test="entity.weight !=null and entity.weight != '' ">
and weight like concat('%',#{entity.weight},'%')
</if>
<if test="entity.weight !=null and entity.weight != '' ">
and weight like concat('%',#{entity.weight},'%')
</if>
ORDER BY business_id DESC
<if test="entity.articleCount !=null and entity.articleCount != '' ">
and article_count like concat('%',#{entity.articleCount},'%')
</if>
<if test="entity.topicName !=null and entity.topicName != '' ">
and topic_name like concat('%',#{entity.topicName},'%')
</if>
ORDER BY cn.exam_status,cn.weight,cn.business_id DESC
</select>
<select id="queryOpmTopicPaged" resultMap="BaseResultMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment