Commit 0c051ab4 by 周海峰

菜谱线路改为查询

parent d4dde8fe
...@@ -185,4 +185,12 @@ public class PlatformRecipesController { ...@@ -185,4 +185,12 @@ public class PlatformRecipesController {
Pagination pagination = new Pagination(page.getList(),new Long(page.getTotal()),pageSize,pageIndex); Pagination pagination = new Pagination(page.getList(),new Long(page.getTotal()),pageSize,pageIndex);
return ResultJson.ok(pagination); return ResultJson.ok(pagination);
} }
/**
* 查询所有线路
*/
@GetMapping("/lineList")
public ResultJson lineList(){
return ResultJson.ok(platformRecipesService.selectLine());
}
} }
...@@ -99,4 +99,9 @@ public interface PlatformRecipesMapper { ...@@ -99,4 +99,9 @@ public interface PlatformRecipesMapper {
int updateStatusByPrimaryKey(PlatformRecipes record); int updateStatusByPrimaryKey(PlatformRecipes record);
PlatformRecipes loadByDateAndLine(Map params); PlatformRecipes loadByDateAndLine(Map params);
/**
* 查询所有线路
*/
List<PlatformRecipes> selectLine();
} }
\ No newline at end of file
...@@ -2,31 +2,24 @@ ...@@ -2,31 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.metro.auth.platform.mapper.PlatformRecipesMapper"> <mapper namespace="com.metro.auth.platform.mapper.PlatformRecipesMapper">
<resultMap id="BaseResultMap" type="com.metro.auth.platform.domain.auth.PlatformRecipes"> <resultMap id="BaseResultMap" type="com.metro.auth.platform.domain.auth.PlatformRecipes">
<!-- <id column="id" jdbcType="VARCHAR" property="id"/>
WARNING - @mbg.generated <result column="title" jdbcType="VARCHAR" property="title"/>
This element is automatically generated by MyBatis Generator, do not modify. <result column="datetime" jdbcType="VARCHAR" property="datetime"/>
--> <result column="weekday" jdbcType="VARCHAR" property="weekday"/>
<id column="id" jdbcType="VARCHAR" property="id" /> <result column="memo" jdbcType="VARCHAR" property="memo"/>
<result column="title" jdbcType="VARCHAR" property="title" /> <result column="status" jdbcType="VARCHAR" property="status"/>
<result column="datetime" jdbcType="VARCHAR" property="datetime" /> <result column="am_zs" jdbcType="VARCHAR" property="am_zs"/>
<result column="weekday" jdbcType="VARCHAR" property="weekday" /> <result column="am_fs" jdbcType="VARCHAR" property="am_fs"/>
<result column="memo" jdbcType="VARCHAR" property="memo" /> <result column="am_qt" jdbcType="VARCHAR" property="am_qt"/>
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="pm_zs" jdbcType="VARCHAR" property="pm_zs"/>
<result column="am_zs" jdbcType="VARCHAR" property="am_zs" /> <result column="pm_fs" jdbcType="VARCHAR" property="pm_fs"/>
<result column="am_fs" jdbcType="VARCHAR" property="am_fs" /> <result column="pm_bc" jdbcType="VARCHAR" property="pm_bc"/>
<result column="am_qt" jdbcType="VARCHAR" property="am_qt" /> <result column="pm_qt" jdbcType="VARCHAR" property="pm_qt"/>
<result column="pm_zs" jdbcType="VARCHAR" property="pm_zs" /> <result column="soup" jdbcType="VARCHAR" property="soup"/>
<result column="pm_fs" jdbcType="VARCHAR" property="pm_fs" /> <result column="line" jdbcType="VARCHAR" property="line"/>
<result column="pm_bc" jdbcType="VARCHAR" property="pm_bc" />
<result column="pm_qt" jdbcType="VARCHAR" property="pm_qt" />
<result column="soup" jdbcType="VARCHAR" property="soup" />
<result column="line" jdbcType="VARCHAR" property="line" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
...@@ -44,7 +37,8 @@ ...@@ -44,7 +37,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
...@@ -55,11 +49,8 @@ ...@@ -55,11 +49,8 @@
</foreach> </foreach>
</where> </where>
</sql> </sql>
<sql id="Update_By_Example_Where_Clause"> <sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where> <where>
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
...@@ -77,7 +68,8 @@ ...@@ -77,7 +68,8 @@
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
...@@ -88,65 +80,52 @@ ...@@ -88,65 +80,52 @@
</foreach> </foreach>
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, title, datetime, weekday, memo, status,am_zs,am_fs,am_qt,pm_zs,pm_fs,pm_qt,pm_bc,soup,line id, title, datetime, weekday, memo, status,am_zs,am_fs,am_qt,pm_zs,pm_fs,pm_qt,pm_bc,soup,line
</sql> </sql>
<select id="selectByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample" resultMap="BaseResultMap">
<!-- <select id="selectByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample"
WARNING - @mbg.generated resultMap="BaseResultMap">
This element is automatically generated by MyBatis Generator, do not modify.
-->
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from platform_recipes from platform_recipes
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
<if test="orderByClause != null"> <if test="orderByClause != null">
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- select
WARNING - @mbg.generated <include refid="Base_Column_List"/>
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from platform_recipes from platform_recipes
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<select id="loadByDateAndLine" resultMap="BaseResultMap" parameterType="map">
<!-- <select id="loadByDateAndLine" resultMap="BaseResultMap" parameterType="map">
WARNING - @mbg.generated select * from platform_recipes where datetime = #{datetime} and line = #{line} limit 1
This element is automatically generated by MyBatis Generator, do not modify. </select>
-->
select * from platform_recipes where datetime = #{datetime} and line = #{line} limit 1 <!-- 查询所有线路-->
<select id="selectLine" resultMap="BaseResultMap">
select line from platform_recipes group by line
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from platform_recipes delete from platform_recipes
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample"> <delete id="deleteByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from platform_recipes delete from platform_recipes
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes"> <insert id="insert" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes">
...@@ -154,15 +133,15 @@ ...@@ -154,15 +133,15 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into platform_recipes (id, title, datetime, insert into platform_recipes (id, title, datetime,
weekday, memo, status,am_zs,am_fs,am_qt,pm_zs,pm_fs,pm_bc,pm_qt,soup,line weekday, memo, status,am_zs,am_fs,am_qt,pm_zs,pm_fs,pm_bc,pm_qt,soup,line
) )
values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{datetime,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{datetime,jdbcType=VARCHAR},
#{weekday,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR} #{weekday,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
, #{am_zs,jdbcType=VARCHAR}, #{am_fs,jdbcType=VARCHAR}, #{am_qt,jdbcType=VARCHAR}, #{pm_zs,jdbcType=VARCHAR} , #{am_zs,jdbcType=VARCHAR}, #{am_fs,jdbcType=VARCHAR}, #{am_qt,jdbcType=VARCHAR}, #{pm_zs,jdbcType=VARCHAR}
, #{pm_fs,jdbcType=VARCHAR}, #{pm_bc,jdbcType=VARCHAR}, #{pm_qt,jdbcType=VARCHAR}, #{soup,jdbcType=VARCHAR} , #{pm_fs,jdbcType=VARCHAR}, #{pm_bc,jdbcType=VARCHAR}, #{pm_qt,jdbcType=VARCHAR}, #{soup,jdbcType=VARCHAR}
, #{line,jdbcType=VARCHAR} , #{line,jdbcType=VARCHAR}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes"> <insert id="insertSelective" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes">
<!-- <!--
...@@ -214,14 +193,15 @@ ...@@ -214,14 +193,15 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipesExample"
resultType="java.lang.Long">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
select count(*) from platform_recipes select count(*) from platform_recipes
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause"/>
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
...@@ -278,7 +258,7 @@ ...@@ -278,7 +258,7 @@
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
...@@ -288,11 +268,11 @@ ...@@ -288,11 +268,11 @@
--> -->
update platform_recipes update platform_recipes
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
datetime = #{record.datetime,jdbcType=VARCHAR}, datetime = #{record.datetime,jdbcType=VARCHAR},
weekday = #{record.weekday,jdbcType=VARCHAR}, weekday = #{record.weekday,jdbcType=VARCHAR},
memo = #{record.memo,jdbcType=VARCHAR}, memo = #{record.memo,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR}, status = #{record.status,jdbcType=VARCHAR},
am_zs = #{record.am_zs,jdbcType=VARCHAR}, am_zs = #{record.am_zs,jdbcType=VARCHAR},
am_fs = #{record.am_fs,jdbcType=VARCHAR}, am_fs = #{record.am_fs,jdbcType=VARCHAR},
am_qt = #{record.am_qt,jdbcType=VARCHAR}, am_qt = #{record.am_qt,jdbcType=VARCHAR},
...@@ -303,7 +283,7 @@ ...@@ -303,7 +283,7 @@
soup = #{record.soup,jdbcType=VARCHAR}, soup = #{record.soup,jdbcType=VARCHAR},
line = #{record.line,jdbcType=VARCHAR} line = #{record.line,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes"> <update id="updateByPrimaryKeySelective" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes">
...@@ -365,11 +345,11 @@ ...@@ -365,11 +345,11 @@
--> -->
update platform_recipes update platform_recipes
set title = #{title,jdbcType=VARCHAR}, set title = #{title,jdbcType=VARCHAR},
datetime = #{datetime,jdbcType=VARCHAR}, datetime = #{datetime,jdbcType=VARCHAR},
weekday = #{weekday,jdbcType=VARCHAR}, weekday = #{weekday,jdbcType=VARCHAR},
memo = #{memo,jdbcType=VARCHAR}, memo = #{memo,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR}, status = #{status,jdbcType=VARCHAR},
am_zs = #{am_zs,jdbcType=VARCHAR}, am_zs = #{am_zs,jdbcType=VARCHAR},
am_fs = #{am_fs,jdbcType=VARCHAR}, am_fs = #{am_fs,jdbcType=VARCHAR},
am_qt = #{am_qt,jdbcType=VARCHAR}, am_qt = #{am_qt,jdbcType=VARCHAR},
pm_zs = #{pm_zs,jdbcType=VARCHAR}, pm_zs = #{pm_zs,jdbcType=VARCHAR},
...@@ -380,13 +360,13 @@ ...@@ -380,13 +360,13 @@
line = #{line,jdbcType=VARCHAR} line = #{line,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateStatusByPrimaryKey" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes" > <update id="updateStatusByPrimaryKey" parameterType="com.metro.auth.platform.domain.auth.PlatformRecipes">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
update platform_recipes update platform_recipes
set status = #{status,jdbcType=VARCHAR} set status = #{status,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -40,4 +40,9 @@ public interface PlatformRecipesService { ...@@ -40,4 +40,9 @@ public interface PlatformRecipesService {
PlatformRecipes loadByDateAndLine(Map params); PlatformRecipes loadByDateAndLine(Map params);
void updateRecipesStatus(String status, String ids); void updateRecipesStatus(String status, String ids);
/**
* 查询所有线路
*/
List<PlatformRecipes> selectLine();
} }
...@@ -21,24 +21,27 @@ import java.util.UUID; ...@@ -21,24 +21,27 @@ import java.util.UUID;
@Slf4j @Slf4j
@Service @Service
public class PlatformRecipesServiceImpl implements PlatformRecipesService{ public class PlatformRecipesServiceImpl implements PlatformRecipesService {
@Resource @Resource
private PlatformRecipesMapper platformRecipesMapper; private PlatformRecipesMapper platformRecipesMapper;
private final JwtUtils jwtTokenUtil; private final JwtUtils jwtTokenUtil;
public PlatformRecipesServiceImpl(JwtUtils jwtTokenUtil) { public PlatformRecipesServiceImpl(JwtUtils jwtTokenUtil) {
this.jwtTokenUtil = jwtTokenUtil; this.jwtTokenUtil = jwtTokenUtil;
} }
@Resource @Resource
public HttpAPIService httpAPIService; public HttpAPIService httpAPIService;
@Override @Override
@DataDictClass @DataDictClass
public List<PlatformRecipes> selectByExample(PlatformRecipes platformRecipes) { public List<PlatformRecipes> selectByExample(PlatformRecipes platformRecipes) {
PlatformRecipesExample example = new PlatformRecipesExample(); PlatformRecipesExample example = new PlatformRecipesExample();
PlatformRecipesExample.Criteria criteria=example.createCriteria(); PlatformRecipesExample.Criteria criteria = example.createCriteria();
if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())) {
criteria.andDatetimeGreaterThanOrEqualTo(platformRecipes.getDatetime()); criteria.andDatetimeGreaterThanOrEqualTo(platformRecipes.getDatetime());
} }
if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())) {
criteria.andLineEqualTo(platformRecipes.getLine()); criteria.andLineEqualTo(platformRecipes.getLine());
} }
criteria.andStatusEqualTo("1"); criteria.andStatusEqualTo("1");
...@@ -46,15 +49,16 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{ ...@@ -46,15 +49,16 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{
return platformRecipesMapper.selectByExample(example); return platformRecipesMapper.selectByExample(example);
} }
@Override @Override
@DataDictClass @DataDictClass
public List<PlatformRecipes> selectByExampleForexcel(PlatformRecipes platformRecipes) { public List<PlatformRecipes> selectByExampleForexcel(PlatformRecipes platformRecipes) {
PlatformRecipesExample example = new PlatformRecipesExample(); PlatformRecipesExample example = new PlatformRecipesExample();
PlatformRecipesExample.Criteria criteria=example.createCriteria(); PlatformRecipesExample.Criteria criteria = example.createCriteria();
if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())) {
criteria.andDatetimeGreaterThanOrEqualTo(platformRecipes.getDatetime()); criteria.andDatetimeGreaterThanOrEqualTo(platformRecipes.getDatetime());
} }
if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())) {
criteria.andLineEqualTo(platformRecipes.getLine()); criteria.andLineEqualTo(platformRecipes.getLine());
} }
// criteria.andStatusEqualTo("1"); // criteria.andStatusEqualTo("1");
...@@ -62,59 +66,59 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{ ...@@ -62,59 +66,59 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{
return platformRecipesMapper.selectByExample(example); return platformRecipesMapper.selectByExample(example);
} }
@Override @Override
public int savePlatformRecipes(PlatformRecipes entity){ public int savePlatformRecipes(PlatformRecipes entity) {
int flag=0; int flag = 0;
Date d = new Date(); Date d = new Date();
//获取最新id //获取最新id
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
uuid = uuid.replace("-", ""); uuid = uuid.replace("-", "");
entity.setId(uuid); entity.setId(uuid);
if (StringUtil.isEmpty(entity.getStatus())) { if (StringUtil.isEmpty(entity.getStatus())) {
entity.setStatus("1"); entity.setStatus("1");
} }
flag=platformRecipesMapper.insert(entity); flag = platformRecipesMapper.insert(entity);
return flag; return flag;
} }
/** /**
*
* @param entity * @param entity
* @return * @return
*/ */
@Override @Override
public int saveUpdatePlatformRecipes(PlatformRecipes entity){ public int saveUpdatePlatformRecipes(PlatformRecipes entity) {
int flag=0; int flag = 0;
flag=platformRecipesMapper.updateByPrimaryKey(entity); flag = platformRecipesMapper.updateByPrimaryKey(entity);
return flag; return flag;
} }
/** /**
*
* @param id * @param id
* @return * @return
*/ */
@Override @Override
public int delPlatformRecipes(String id){ public int delPlatformRecipes(String id) {
int flag=platformRecipesMapper.deleteByPrimaryKey(id); int flag = platformRecipesMapper.deleteByPrimaryKey(id);
return flag; return flag;
} }
/** /**
*根据id更新启用状态 * 根据id更新启用状态
*
* @param entity * @param entity
* @return * @return
*/ */
@Override @Override
public int updatePlatformRecipesStatusById(PlatformRecipes entity){ public int updatePlatformRecipesStatusById(PlatformRecipes entity) {
int flag=0; int flag = 0;
//更改状态 //更改状态
flag= platformRecipesMapper.updateStatusByPrimaryKey(entity); flag = platformRecipesMapper.updateStatusByPrimaryKey(entity);
return flag; return flag;
} }
/** /**
*
* @param platformRecipes * @param platformRecipes
* @param pageNum * @param pageNum
* @param pageSize * @param pageSize
...@@ -122,55 +126,60 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{ ...@@ -122,55 +126,60 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{
*/ */
@Override @Override
@DataDictClass @DataDictClass
public PageInfo<PlatformRecipes> pagedlist(PlatformRecipes platformRecipes, int pageNum, int pageSize) { public PageInfo<PlatformRecipes> pagedlist(PlatformRecipes platformRecipes, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
PlatformRecipesExample platformRecipesExample = new PlatformRecipesExample(); PlatformRecipesExample platformRecipesExample = new PlatformRecipesExample();
PlatformRecipesExample.Criteria criteria = platformRecipesExample.createCriteria(); PlatformRecipesExample.Criteria criteria = platformRecipesExample.createCriteria();
//搜索 //搜索
if (platformRecipes!=null){ if (platformRecipes != null) {
if (!EmptyUtilHelper.isEmpty(platformRecipes.getTitle())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getTitle())) {
criteria.andTitleLike( "%"+platformRecipes.getTitle()+"%"); criteria.andTitleLike("%" + platformRecipes.getTitle() + "%");
}
if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())){
criteria.andLineLike( "%"+platformRecipes.getLine()+"%");
}
if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())){
criteria.andDatetimeEqualTo(platformRecipes.getDatetime());
}
} }
if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())) {
criteria.andLineLike("%" + platformRecipes.getLine() + "%");
}
if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())) {
criteria.andDatetimeEqualTo(platformRecipes.getDatetime());
}
}
platformRecipesExample.setOrderByClause(" datetime desc"); platformRecipesExample.setOrderByClause(" datetime desc");
List<PlatformRecipes> list=platformRecipesMapper.selectByExample(platformRecipesExample); List<PlatformRecipes> list = platformRecipesMapper.selectByExample(platformRecipesExample);
PageInfo<PlatformRecipes> pageInfo = new PageInfo<>(list); PageInfo<PlatformRecipes> pageInfo = new PageInfo<>(list);
return pageInfo;
}
@Override
public PlatformRecipes load(String id) {
PlatformRecipes platformRecipes = platformRecipesMapper.selectByPrimaryKey(id);
return platformRecipes;
}
return pageInfo;
}
@Override
public PlatformRecipes load(String id){
PlatformRecipes platformRecipes=platformRecipesMapper.selectByPrimaryKey(id);
return platformRecipes;
}
/** /**
* 批量启停,微信无操作 * 批量启停,微信无操作
*
* @param status * @param status
* @param ids * @param ids
*/ */
@Override @Override
public void updateRecipesStatus(String status,String ids) { public void updateRecipesStatus(String status, String ids) {
String[] id = ids.split(","); String[] id = ids.split(",");
for (int i=0;i<id.length;i++ ) { for (int i = 0; i < id.length; i++) {
PlatformRecipes platformRecipes=platformRecipesMapper.selectByPrimaryKey(id[i]); PlatformRecipes platformRecipes = platformRecipesMapper.selectByPrimaryKey(id[i]);
platformRecipes.setStatus(status); platformRecipes.setStatus(status);
int flag=platformRecipesMapper.updateStatusByPrimaryKey(platformRecipes); int flag = platformRecipesMapper.updateStatusByPrimaryKey(platformRecipes);
} }
} }
@Override @Override
public PlatformRecipes loadByDateAndLine(Map params){ public PlatformRecipes loadByDateAndLine(Map params) {
PlatformRecipes platformRecipes=platformRecipesMapper.loadByDateAndLine(params); PlatformRecipes platformRecipes = platformRecipesMapper.loadByDateAndLine(params);
return platformRecipes; return platformRecipes;
} }
@Override @Override
@DataDictClass @DataDictClass
public PageInfo<PlatformRecipes> pagedlisthome(PlatformRecipes platformRecipes, int pageNum, int pageSize) { public PageInfo<PlatformRecipes> pagedlisthome(PlatformRecipes platformRecipes, int pageNum, int pageSize) {
...@@ -179,23 +188,31 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{ ...@@ -179,23 +188,31 @@ public class PlatformRecipesServiceImpl implements PlatformRecipesService{
PlatformRecipesExample platformRecipesExample = new PlatformRecipesExample(); PlatformRecipesExample platformRecipesExample = new PlatformRecipesExample();
PlatformRecipesExample.Criteria criteria = platformRecipesExample.createCriteria(); PlatformRecipesExample.Criteria criteria = platformRecipesExample.createCriteria();
//搜索 //搜索
if (platformRecipes!=null){ if (platformRecipes != null) {
// if (!EmptyUtilHelper.isEmpty(platformRecipes.getTitle())){ // if (!EmptyUtilHelper.isEmpty(platformRecipes.getTitle())){
// criteria.andTitleLike( "%"+platformRecipes.getTitle()+"%"); // criteria.andTitleLike( "%"+platformRecipes.getTitle()+"%");
// } // }
if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getDatetime())) {
criteria.andDatetimeEqualTo(platformRecipes.getDatetime()); criteria.andDatetimeEqualTo(platformRecipes.getDatetime());
} }
if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())){ if (!EmptyUtilHelper.isEmpty(platformRecipes.getLine())) {
criteria.andLineEqualTo(platformRecipes.getLine()); criteria.andLineEqualTo(platformRecipes.getLine());
} }
} }
criteria.andStatusEqualTo("1"); criteria.andStatusEqualTo("1");
platformRecipesExample.setOrderByClause(" datetime desc"); platformRecipesExample.setOrderByClause(" datetime desc");
List<PlatformRecipes> list=platformRecipesMapper.selectByExample(platformRecipesExample); List<PlatformRecipes> list = platformRecipesMapper.selectByExample(platformRecipesExample);
PageInfo<PlatformRecipes> pageInfo = new PageInfo<>(list); PageInfo<PlatformRecipes> pageInfo = new PageInfo<>(list);
return pageInfo; return pageInfo;
} }
/**
* 查询所有线路
*/
@Override
public List<PlatformRecipes> selectLine() {
return platformRecipesMapper.selectLine();
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论