外食计算器
This commit is contained in:
@ -3,6 +3,7 @@ package com.stdiet.custom.domain;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
@ -14,6 +15,7 @@ import com.stdiet.common.core.domain.BaseEntity;
|
||||
* @author xzj
|
||||
* @date 2020-12-31
|
||||
*/
|
||||
@Data
|
||||
public class SysCustomer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -21,6 +23,9 @@ public class SysCustomer extends BaseEntity
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
//加密ID
|
||||
private String encId;
|
||||
|
||||
/** 名字 */
|
||||
@Excel(name = "名字")
|
||||
private String name;
|
||||
@ -90,188 +95,4 @@ public class SysCustomer extends BaseEntity
|
||||
/** 体征数据,非持久化字段 */
|
||||
private SysCustomerPhysicalSigns sign;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
public void setPayDate(Date payDate)
|
||||
{
|
||||
this.payDate = payDate;
|
||||
}
|
||||
|
||||
public Date getPayDate()
|
||||
{
|
||||
return payDate;
|
||||
}
|
||||
public void setStartDate(Date startDate)
|
||||
{
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getStartDate()
|
||||
{
|
||||
return startDate;
|
||||
}
|
||||
public void setPurchaseNum(Long purchaseNum)
|
||||
{
|
||||
this.purchaseNum = purchaseNum;
|
||||
}
|
||||
|
||||
public Long getPurchaseNum()
|
||||
{
|
||||
return purchaseNum;
|
||||
}
|
||||
public void setPayTotal(BigDecimal payTotal)
|
||||
{
|
||||
this.payTotal = payTotal;
|
||||
}
|
||||
|
||||
public BigDecimal getPayTotal()
|
||||
{
|
||||
return payTotal;
|
||||
}
|
||||
public void setMainDietitian(Long mainDietitian)
|
||||
{
|
||||
this.mainDietitian = mainDietitian;
|
||||
}
|
||||
|
||||
public Long getMainDietitian()
|
||||
{
|
||||
return mainDietitian;
|
||||
}
|
||||
public void setAssistantDietitian(Long assistantDietitian)
|
||||
{
|
||||
this.assistantDietitian = assistantDietitian;
|
||||
}
|
||||
|
||||
public Long getAssistantDietitian()
|
||||
{
|
||||
return assistantDietitian;
|
||||
}
|
||||
public void setAfterDietitian(Long afterDietitian)
|
||||
{
|
||||
this.afterDietitian = afterDietitian;
|
||||
}
|
||||
|
||||
public Long getAfterDietitian()
|
||||
{
|
||||
return afterDietitian;
|
||||
}
|
||||
public void setSalesman(Long salesman)
|
||||
{
|
||||
this.salesman = salesman;
|
||||
}
|
||||
|
||||
public Long getSalesman()
|
||||
{
|
||||
return salesman;
|
||||
}
|
||||
public void setChargePerson(Long chargePerson)
|
||||
{
|
||||
this.chargePerson = chargePerson;
|
||||
}
|
||||
|
||||
public Long getChargePerson()
|
||||
{
|
||||
return chargePerson;
|
||||
}
|
||||
public void setFollowStatus(Long followStatus)
|
||||
{
|
||||
this.followStatus = followStatus;
|
||||
}
|
||||
|
||||
public Long getFollowStatus()
|
||||
{
|
||||
return followStatus;
|
||||
}
|
||||
|
||||
public SysCustomerPhysicalSigns getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(SysCustomerPhysicalSigns sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public Integer getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Date getFansTime() {
|
||||
return fansTime;
|
||||
}
|
||||
|
||||
public void setFansTime(Date fansTime) {
|
||||
this.fansTime = fansTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("phone", getPhone())
|
||||
.append("email", getEmail())
|
||||
.append("address", getAddress())
|
||||
.append("payDate", getPayDate())
|
||||
.append("startDate", getStartDate())
|
||||
.append("purchaseNum", getPurchaseNum())
|
||||
.append("payTotal", getPayTotal())
|
||||
.append("mainDietitian", getMainDietitian())
|
||||
.append("assistantDietitian", getAssistantDietitian())
|
||||
.append("afterDietitian", getAfterDietitian())
|
||||
.append("salesman", getSalesman())
|
||||
.append("chargePerson", getChargePerson())
|
||||
.append("followStatus", getFollowStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 外食热量统计对象 sys_food_heat_statistics
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-02-19
|
||||
*/
|
||||
@Data
|
||||
public class SysFoodHeatStatistics extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
/** 食材 */
|
||||
@Excel(name = "食材")
|
||||
private String ingredient;
|
||||
|
||||
/** 通俗单位ID */
|
||||
@Excel(name = "通俗单位ID")
|
||||
private Long unit;
|
||||
|
||||
private String unitName;
|
||||
|
||||
/** 通俗单位数量 */
|
||||
@Excel(name = "通俗单位数量")
|
||||
private Integer number;
|
||||
|
||||
/** 具体质量,单位:克 */
|
||||
@Excel(name = "具体质量,单位:克")
|
||||
private Integer quantity;
|
||||
|
||||
/** 食用日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "食用日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date edibleDate;
|
||||
|
||||
/** 类型,0早 1中 2晚 */
|
||||
@Excel(name = "类型,0早 1中 2晚")
|
||||
private Integer edibleType;
|
||||
|
||||
/** 热量数值 */
|
||||
@Excel(name = "热量数值")
|
||||
private Integer heatValue;
|
||||
|
||||
/** 热量缺口 */
|
||||
@Excel(name = "热量缺口")
|
||||
private Integer heatGap;
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
@ -29,6 +29,8 @@ public class SysWxFanStatistics extends BaseEntity
|
||||
@Excel(name = "进粉账号")
|
||||
private String account;
|
||||
|
||||
private Long accountId;
|
||||
|
||||
//销售组别
|
||||
private String saleGroup;
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.stdiet.custom.dto.request;
|
||||
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FoodHeatCalculatorRequest extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//客户ID加密串
|
||||
private String customerEncId;
|
||||
|
||||
//食材数据对应JSON数组字符串
|
||||
private String ingredientArray;
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysFoodHeatStatistics;
|
||||
|
||||
/**
|
||||
* 外食热量统计Mapper接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-02-19
|
||||
*/
|
||||
public interface SysFoodHeatStatisticsMapper {
|
||||
/**
|
||||
* 查询外食热量统计
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 外食热量统计
|
||||
*/
|
||||
public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询外食热量统计列表
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 外食热量统计集合
|
||||
*/
|
||||
public List<SysFoodHeatStatistics> selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 新增外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 修改外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 删除外食热量统计
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFoodHeatStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除外食热量统计
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFoodHeatStatisticsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
* @param sysFoodHeatStatisticsList
|
||||
* @return
|
||||
*/
|
||||
public int insertFoodHeatBatch(List<HashMap> sysFoodHeatStatisticsList);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.stdiet.custom.domain.SysFoodHeatStatistics;
|
||||
import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest;
|
||||
|
||||
/**
|
||||
* 外食热量统计Service接口
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-02-19
|
||||
*/
|
||||
public interface ISysFoodHeatStatisticsService
|
||||
{
|
||||
/**
|
||||
* 查询外食热量统计
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 外食热量统计
|
||||
*/
|
||||
public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询外食热量统计列表
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 外食热量统计集合
|
||||
*/
|
||||
public List<SysFoodHeatStatistics> selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 新增外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 修改外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics);
|
||||
|
||||
/**
|
||||
* 批量删除外食热量统计
|
||||
*
|
||||
* @param ids 需要删除的外食热量统计ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFoodHeatStatisticsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除外食热量统计信息
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFoodHeatStatisticsById(Long id);
|
||||
|
||||
/**
|
||||
* 客户自己添加外食计算数据,批量添加
|
||||
* @param foodHeatCalculatorRequest
|
||||
* @return
|
||||
*/
|
||||
public int addMuchFoodHeat(FoodHeatCalculatorRequest foodHeatCalculatorRequest);
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.common.utils.sign.AesUtils;
|
||||
import com.stdiet.custom.dto.request.FoodHeatCalculatorRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysFoodHeatStatisticsMapper;
|
||||
import com.stdiet.custom.domain.SysFoodHeatStatistics;
|
||||
import com.stdiet.custom.service.ISysFoodHeatStatisticsService;
|
||||
|
||||
/**
|
||||
* 外食热量统计Service业务层处理
|
||||
*
|
||||
* @author xzj
|
||||
* @date 2021-02-19
|
||||
*/
|
||||
@Service
|
||||
public class SysFoodHeatStatisticsServiceImpl implements ISysFoodHeatStatisticsService
|
||||
{
|
||||
@Autowired
|
||||
private SysFoodHeatStatisticsMapper sysFoodHeatStatisticsMapper;
|
||||
|
||||
/**
|
||||
* 查询外食热量统计
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 外食热量统计
|
||||
*/
|
||||
@Override
|
||||
public SysFoodHeatStatistics selectSysFoodHeatStatisticsById(Long id)
|
||||
{
|
||||
return sysFoodHeatStatisticsMapper.selectSysFoodHeatStatisticsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询外食热量统计列表
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 外食热量统计
|
||||
*/
|
||||
@Override
|
||||
public List<SysFoodHeatStatistics> selectSysFoodHeatStatisticsList(SysFoodHeatStatistics sysFoodHeatStatistics)
|
||||
{
|
||||
return sysFoodHeatStatisticsMapper.selectSysFoodHeatStatisticsList(sysFoodHeatStatistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics)
|
||||
{
|
||||
sysFoodHeatStatistics.setCreateTime(DateUtils.getNowDate());
|
||||
return sysFoodHeatStatisticsMapper.insertSysFoodHeatStatistics(sysFoodHeatStatistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改外食热量统计
|
||||
*
|
||||
* @param sysFoodHeatStatistics 外食热量统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysFoodHeatStatistics(SysFoodHeatStatistics sysFoodHeatStatistics)
|
||||
{
|
||||
sysFoodHeatStatistics.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysFoodHeatStatisticsMapper.updateSysFoodHeatStatistics(sysFoodHeatStatistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除外食热量统计
|
||||
*
|
||||
* @param ids 需要删除的外食热量统计ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFoodHeatStatisticsByIds(Long[] ids)
|
||||
{
|
||||
return sysFoodHeatStatisticsMapper.deleteSysFoodHeatStatisticsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除外食热量统计信息
|
||||
*
|
||||
* @param id 外食热量统计ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFoodHeatStatisticsById(Long id)
|
||||
{
|
||||
return sysFoodHeatStatisticsMapper.deleteSysFoodHeatStatisticsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户自己添加外食计算数据,批量添加
|
||||
* @param foodHeatCalculatorRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int addMuchFoodHeat(FoodHeatCalculatorRequest foodHeatCalculatorRequest){
|
||||
//客户ID解密
|
||||
String customerId = StringUtils.isNotEmpty(foodHeatCalculatorRequest.getCustomerEncId()) ? AesUtils.decrypt(foodHeatCalculatorRequest.getCustomerEncId(), null) : "";
|
||||
if(StringUtils.isEmpty(customerId)){
|
||||
return 0;
|
||||
}
|
||||
List<SysFoodHeatStatistics> list = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(foodHeatCalculatorRequest.getIngredientArray())){
|
||||
List<HashMap> foodHeatList = JSON.parseArray(foodHeatCalculatorRequest.getIngredientArray(), HashMap.class);
|
||||
for(HashMap map : foodHeatList){
|
||||
map.put("customerId", customerId);
|
||||
}
|
||||
return sysFoodHeatStatisticsMapper.insertFoodHeatBatch(foodHeatList);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.stdiet.custom.mapper.SysFoodHeatStatisticsMapper">
|
||||
|
||||
<resultMap type="SysFoodHeatStatistics" id="SysFoodHeatStatisticsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="ingredient" column="ingredient" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="number" column="number" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="edibleDate" column="edible_date" />
|
||||
<result property="edibleType" column="edible_type" />
|
||||
<result property="heatValue" column="heat_value" />
|
||||
<result property="heatGap" column="heat_gap" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
|
||||
<result property="unitName" column="unitName"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysFoodHeatStatisticsVo">
|
||||
select id, customer_id, ingredient, unit, number, quantity, edible_date, edible_type, heat_value, heat_gap, create_time, create_by, update_time, update_by, del_flag from sys_food_heat_statistics
|
||||
</sql>
|
||||
|
||||
<select id="selectSysFoodHeatStatisticsList" parameterType="SysFoodHeatStatistics" resultMap="SysFoodHeatStatisticsResult">
|
||||
select sfhs.id, sfhs.customer_id, sfhs.ingredient, sfhs.unit, sfhs.number, sfhs.quantity, sfhs.edible_date, sfhs.edible_type, sfhs.heat_value, sfhs.heat_gap,cusUnit.dict_label as unitName
|
||||
from sys_food_heat_statistics as sfhs
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_cus_unit') AS cusUnit ON cusUnit.dict_value = sfhs.unit
|
||||
where sfhs.del_flag = 0
|
||||
<if test="customerId != null "> and sfhs.customer_id = #{customerId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysFoodHeatStatisticsById" parameterType="Long" resultMap="SysFoodHeatStatisticsResult">
|
||||
<include refid="selectSysFoodHeatStatisticsVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysFoodHeatStatistics" parameterType="SysFoodHeatStatistics" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_food_heat_statistics
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="ingredient != null">ingredient,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="number != null">number,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="edibleDate != null">edible_date,</if>
|
||||
<if test="edibleType != null">edible_type,</if>
|
||||
<if test="heatValue != null">heat_value,</if>
|
||||
<if test="heatGap != null">heat_gap,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="ingredient != null">#{ingredient},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="number != null">#{number},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="edibleDate != null">#{edibleDate},</if>
|
||||
<if test="edibleType != null">#{edibleType},</if>
|
||||
<if test="heatValue != null">#{heatValue},</if>
|
||||
<if test="heatGap != null">#{heatGap},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysFoodHeatStatistics" parameterType="SysFoodHeatStatistics">
|
||||
update sys_food_heat_statistics
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="ingredient != null">ingredient = #{ingredient},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="number != null">number = #{number},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="edibleDate != null">edible_date = #{edibleDate},</if>
|
||||
<if test="edibleType != null">edible_type = #{edibleType},</if>
|
||||
<if test="heatValue != null">heat_value = #{heatValue},</if>
|
||||
<if test="heatGap != null">heat_gap = #{heatGap},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysFoodHeatStatisticsById" parameterType="Long">
|
||||
update sys_food_heat_statistics set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysFoodHeatStatisticsByIds" parameterType="String">
|
||||
update sys_food_heat_statistics set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<insert id="insertFoodHeatBatch" parameterType="java.util.List">
|
||||
insert into sys_food_heat_statistics(customer_id,ingredient,unit,number,quantity) values
|
||||
<foreach collection ="list" item="food" index= "index" separator =",">
|
||||
(#{food.customerId}, #{food.ingredient},#{food.unit},#{food.number},#{food.quantity})
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
</mapper>
|
@ -44,6 +44,7 @@
|
||||
<include refid="selectSysWxFanStatisticsVoExtended"/> where swfs.del_flag = 0
|
||||
<if test="fanTime != null ">and swfs.fan_time = #{fanTime}</if>
|
||||
<if test="userId != null">and su.user_id = #{userId}</if>
|
||||
<if test="accountId != null">and swd.account_id = #{accountId}</if>
|
||||
<if test="sortFlag == null or sortFlag == 0">
|
||||
order by swfs.id desc
|
||||
</if>
|
||||
|
Reference in New Issue
Block a user