fuliqi
2024-04-03 24417dad13f370cca36f6f52208daa0404de4dd6
新核算
7个文件已修改
7个文件已添加
612 ■■■■■ 已修改文件
document/任务排期表.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
document/自贡项目任务分配.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
document/ÈÎÎñÅÅÆÚ±í.xlsx
Binary files differ
document/×Ô¹±ÏîÄ¿ÈÎÎñ·ÖÅä.xlsx
Binary files differ
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRecord.java
New file
@@ -0,0 +1,126 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.entity.BaseEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
 * æ ¸ç®—记录对象 t_calculate_record
 *
 * @author ruoyi
 * @date 2024-04-03
 */
public class CalculateRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** $column.columnComment */
    private Long id;
    /** æ ¸ç®—记录日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "核算记录日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date date;
    /** æ ¸ç®—规则 */
    @Excel(name = "核算规则")
    private Long ruleId;
    /** å•位id */
    @Excel(name = "单位id")
    private Long unitId;
    /** æ€»æœåŠ¡è´¹ */
    @Excel(name = "总服务费")
    private BigDecimal totalMount;
    /** æ‰£å‡æœåŠ¡è´¹ */
    @Excel(name = "扣减服务费")
    private BigDecimal deductAmount;
    /** è€ƒæ ¸åˆ†æ•° */
    @Excel(name = "考核分数")
    private BigDecimal score;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setDate(Date date)
    {
        this.date = date;
    }
    public Date getDate()
    {
        return date;
    }
    public void setRuleId(Long ruleId)
    {
        this.ruleId = ruleId;
    }
    public Long getRuleId()
    {
        return ruleId;
    }
    public void setUnitId(Long unitId)
    {
        this.unitId = unitId;
    }
    public Long getUnitId()
    {
        return unitId;
    }
    public void setTotalMount(BigDecimal totalMount)
    {
        this.totalMount = totalMount;
    }
    public BigDecimal getTotalMount()
    {
        return totalMount;
    }
    public void setDeductAmount(BigDecimal deductAmount)
    {
        this.deductAmount = deductAmount;
    }
    public BigDecimal getDeductAmount()
    {
        return deductAmount;
    }
    public void setScore(BigDecimal score)
    {
        this.score = score;
    }
    public BigDecimal getScore()
    {
        return score;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("date", getDate())
            .append("ruleId", getRuleId())
            .append("unitId", getUnitId())
            .append("totalMount", getTotalMount())
            .append("deductAmount", getDeductAmount())
            .append("score", getScore())
            .toString();
    }
}
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java
@@ -1,7 +1,7 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
import com.ycl.system.entity.BaseEntity;
import com.ycl.system.domain.TreeEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
@@ -11,25 +11,22 @@
 * æ ¸ç®—规则对象 t_calculate_rule
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-03
 */
public class CalculateRule extends BaseEntity
public class CalculateRule extends TreeEntity
{
    private static final long serialVersionUID = 1L;
    /** $column.columnComment */
    /**  */
    private Long id;
    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    /**  */
    @Excel(name = "")
    private String name;
    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    /**  */
    @Excel(name = "")
    private Long templateId;
    /** $column.columnComment */
    private Long parentId;
    /** å•位id */
    @Excel(name = "单位id")
@@ -38,6 +35,10 @@
    /** æ¯å°‘1%扣当月总服务费的多少 */
    @Excel(name = "每少1%扣当月总服务费的多少")
    private BigDecimal value;
    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String description;
    public void setId(Long id) 
    {
@@ -66,15 +67,6 @@
    {
        return templateId;
    }
    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }
    public Long getParentId()
    {
        return parentId;
    }
    public void setUnitId(Long unitId) 
    {
        this.unitId = unitId;
@@ -93,6 +85,15 @@
    {
        return value;
    }
    public void setDescription(String description)
    {
        this.description = description;
    }
    public String getDescription()
    {
        return description;
    }
    @Override
    public String toString() {
@@ -103,6 +104,7 @@
            .append("parentId", getParentId())
            .append("unitId", getUnitId())
            .append("value", getValue())
            .append("description", getDescription())
            .toString();
    }
}
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRecordController.java
New file
@@ -0,0 +1,98 @@
package com.ycl.platform.controller;
import annotation.Log;
import com.ycl.platform.domain.entity.CalculateRecord;
import com.ycl.platform.service.ICalculateRecordService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * æ ¸ç®—记录Controller
 *
 * @author ruoyi
 * @date 2024-04-03
 */
@RestController
@RequestMapping("/calculate/record")
public class CalculateRecordController extends BaseController
{
    @Autowired
    private ICalculateRecordService calculateRecordService;
    /**
     * æŸ¥è¯¢æ ¸ç®—记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:record:list')")
    @GetMapping("/list")
    public TableDataInfo list(CalculateRecord calculateRecord)
    {
        startPage();
        List<CalculateRecord> list = calculateRecordService.selectCalculateRecordList(calculateRecord);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºæ ¸ç®—记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:record:export')")
    @Log(title = "核算记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, CalculateRecord calculateRecord)
    {
        List<CalculateRecord> list = calculateRecordService.selectCalculateRecordList(calculateRecord);
        ExcelUtil<CalculateRecord> util = new ExcelUtil<CalculateRecord>(CalculateRecord.class);
        util.exportExcel(response, list, "核算记录数据");
    }
    /**
     * èŽ·å–æ ¸ç®—è®°å½•è¯¦ç»†ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('system:record:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(calculateRecordService.selectCalculateRecordById(id));
    }
    /**
     * æ–°å¢žæ ¸ç®—记录
     */
    @PreAuthorize("@ss.hasPermi('system:record:add')")
    @Log(title = "核算记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CalculateRecord calculateRecord)
    {
        return toAjax(calculateRecordService.insertCalculateRecord(calculateRecord));
    }
    /**
     * ä¿®æ”¹æ ¸ç®—记录
     */
    @PreAuthorize("@ss.hasPermi('system:record:edit')")
    @Log(title = "核算记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CalculateRecord calculateRecord)
    {
        return toAjax(calculateRecordService.updateCalculateRecord(calculateRecord));
    }
    /**
     * åˆ é™¤æ ¸ç®—记录
     */
    @PreAuthorize("@ss.hasPermi('system:record:remove')")
    @Log(title = "核算记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(calculateRecordService.deleteCalculateRecordByIds(ids));
    }
}
ycl-server/src/main/java/com/ycl/platform/controller/CalculateRuleController.java
@@ -5,7 +5,6 @@
import com.ycl.platform.service.ICalculateRuleService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
@@ -19,10 +18,10 @@
 * æ ¸ç®—规则Controller
 *
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-03
 */
@RestController
@RequestMapping("/check/calculateRule")
@RequestMapping("/calculate/rule")
public class CalculateRuleController extends BaseController
{
    @Autowired
@@ -31,19 +30,18 @@
    /**
     * æŸ¥è¯¢æ ¸ç®—规则列表
     */
    @PreAuthorize("@ss.hasPermi('system:rule:list')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:list')")
    @GetMapping("/list")
    public TableDataInfo list(CalculateRule calculateRule)
    public AjaxResult list(CalculateRule calculateRule)
    {
        startPage();
        List<CalculateRule> list = calculateRuleService.selectCalculateRuleList(calculateRule);
        return getDataTable(list);
        return success(list);
    }
    /**
     * å¯¼å‡ºæ ¸ç®—规则列表
     */
    @PreAuthorize("@ss.hasPermi('system:rule:export')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:export')")
    @Log(title = "核算规则", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, CalculateRule calculateRule)
@@ -56,7 +54,7 @@
    /**
     * èŽ·å–æ ¸ç®—è§„åˆ™è¯¦ç»†ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('system:rule:query')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
@@ -66,7 +64,7 @@
    /**
     * æ–°å¢žæ ¸ç®—规则
     */
    @PreAuthorize("@ss.hasPermi('system:rule:add')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:add')")
    @Log(title = "核算规则", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CalculateRule calculateRule)
@@ -77,7 +75,7 @@
    /**
     * ä¿®æ”¹æ ¸ç®—规则
     */
    @PreAuthorize("@ss.hasPermi('system:rule:edit')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:edit')")
    @Log(title = "核算规则", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CalculateRule calculateRule)
@@ -88,7 +86,7 @@
    /**
     * åˆ é™¤æ ¸ç®—规则
     */
    @PreAuthorize("@ss.hasPermi('system:rule:remove')")
    @PreAuthorize("@ss.hasPermi('calculate:rule:remove')")
    @Log(title = "核算规则", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRecordMapper.java
New file
@@ -0,0 +1,62 @@
package com.ycl.platform.mapper;
import com.ycl.platform.domain.entity.CalculateRecord;
import java.util.List;
/**
 * æ ¸ç®—记录Mapper接口
 *
 * @author ruoyi
 * @date 2024-04-03
 */
public interface CalculateRecordMapper
{
    /**
     * æŸ¥è¯¢æ ¸ç®—记录
     *
     * @param id æ ¸ç®—记录主键
     * @return æ ¸ç®—记录
     */
    public CalculateRecord selectCalculateRecordById(Long id);
    /**
     * æŸ¥è¯¢æ ¸ç®—记录列表
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return æ ¸ç®—记录集合
     */
    public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord);
    /**
     * æ–°å¢žæ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    public int insertCalculateRecord(CalculateRecord calculateRecord);
    /**
     * ä¿®æ”¹æ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    public int updateCalculateRecord(CalculateRecord calculateRecord);
    /**
     * åˆ é™¤æ ¸ç®—记录
     *
     * @param id æ ¸ç®—记录主键
     * @return ç»“æžœ
     */
    public int deleteCalculateRecordById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤æ ¸ç®—记录
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteCalculateRecordByIds(Long[] ids);
}
ycl-server/src/main/java/com/ycl/platform/mapper/CalculateRuleMapper.java
@@ -8,7 +8,7 @@
 * æ ¸ç®—规则Mapper接口
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-03
 */
public interface CalculateRuleMapper 
{
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRecordService.java
New file
@@ -0,0 +1,62 @@
package com.ycl.platform.service;
import com.ycl.platform.domain.entity.CalculateRecord;
import java.util.List;
/**
 * æ ¸ç®—记录Service接口
 *
 * @author ruoyi
 * @date 2024-04-03
 */
public interface ICalculateRecordService
{
    /**
     * æŸ¥è¯¢æ ¸ç®—记录
     *
     * @param id æ ¸ç®—记录主键
     * @return æ ¸ç®—记录
     */
    public CalculateRecord selectCalculateRecordById(Long id);
    /**
     * æŸ¥è¯¢æ ¸ç®—记录列表
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return æ ¸ç®—记录集合
     */
    public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord);
    /**
     * æ–°å¢žæ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    public int insertCalculateRecord(CalculateRecord calculateRecord);
    /**
     * ä¿®æ”¹æ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    public int updateCalculateRecord(CalculateRecord calculateRecord);
    /**
     * æ‰¹é‡åˆ é™¤æ ¸ç®—记录
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ ¸ç®—记录主键集合
     * @return ç»“æžœ
     */
    public int deleteCalculateRecordByIds(Long[] ids);
    /**
     * åˆ é™¤æ ¸ç®—记录信息
     *
     * @param id æ ¸ç®—记录主键
     * @return ç»“æžœ
     */
    public int deleteCalculateRecordById(Long id);
}
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java
@@ -8,7 +8,7 @@
 * æ ¸ç®—规则Service接口
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-03
 */
public interface ICalculateRuleService 
{
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRecordServiceImpl.java
New file
@@ -0,0 +1,94 @@
package com.ycl.platform.service.impl;
import com.ycl.platform.domain.entity.CalculateRecord;
import com.ycl.platform.mapper.CalculateRecordMapper;
import com.ycl.platform.service.ICalculateRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * æ ¸ç®—记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-03
 */
@Service
public class CalculateRecordServiceImpl implements ICalculateRecordService
{
    @Autowired
    private CalculateRecordMapper calculateRecordMapper;
    /**
     * æŸ¥è¯¢æ ¸ç®—记录
     *
     * @param id æ ¸ç®—记录主键
     * @return æ ¸ç®—记录
     */
    @Override
    public CalculateRecord selectCalculateRecordById(Long id)
    {
        return calculateRecordMapper.selectCalculateRecordById(id);
    }
    /**
     * æŸ¥è¯¢æ ¸ç®—记录列表
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return æ ¸ç®—记录
     */
    @Override
    public List<CalculateRecord> selectCalculateRecordList(CalculateRecord calculateRecord)
    {
        return calculateRecordMapper.selectCalculateRecordList(calculateRecord);
    }
    /**
     * æ–°å¢žæ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    @Override
    public int insertCalculateRecord(CalculateRecord calculateRecord)
    {
        return calculateRecordMapper.insertCalculateRecord(calculateRecord);
    }
    /**
     * ä¿®æ”¹æ ¸ç®—记录
     *
     * @param calculateRecord æ ¸ç®—记录
     * @return ç»“æžœ
     */
    @Override
    public int updateCalculateRecord(CalculateRecord calculateRecord)
    {
        return calculateRecordMapper.updateCalculateRecord(calculateRecord);
    }
    /**
     * æ‰¹é‡åˆ é™¤æ ¸ç®—记录
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ ¸ç®—记录主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteCalculateRecordByIds(Long[] ids)
    {
        return calculateRecordMapper.deleteCalculateRecordByIds(ids);
    }
    /**
     * åˆ é™¤æ ¸ç®—记录信息
     *
     * @param id æ ¸ç®—记录主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteCalculateRecordById(Long id)
    {
        return calculateRecordMapper.deleteCalculateRecordById(id);
    }
}
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java
@@ -12,7 +12,7 @@
 * æ ¸ç®—规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-03
 */
@Service
public class CalculateRuleServiceImpl implements ICalculateRuleService 
ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
New file
@@ -0,0 +1,83 @@
<?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.ycl.platform.mapper.CalculateRecordMapper">
    <resultMap type="com.ycl.platform.domain.entity.CalculateRecord" id="CalculateRecordResult">
        <result property="id"    column="id"    />
        <result property="date"    column="date"    />
        <result property="ruleId"    column="rule_id"    />
        <result property="unitId"    column="unit_id"    />
        <result property="totalMount"    column="totalMount"    />
        <result property="deductAmount"    column="deduct_amount"    />
        <result property="score"    column="score"    />
    </resultMap>
    <sql id="selectCalculateRecordVo">
        select id, date, rule_id, unit_id, totalMount, deduct_amount, score from t_calculate_record
    </sql>
    <select id="selectCalculateRecordList" resultMap="CalculateRecordResult">
        <include refid="selectCalculateRecordVo"/>
        <where>
            <if test="date != null "> and date = #{date}</if>
            <if test="ruleId != null "> and rule_id = #{ruleId}</if>
            <if test="unitId != null "> and unit_id = #{unitId}</if>
            <if test="totalMount != null "> and totalMount = #{totalMount}</if>
            <if test="deductAmount != null "> and deduct_amount = #{deductAmount}</if>
            <if test="score != null "> and score = #{score}</if>
        </where>
    </select>
    <select id="selectCalculateRecordById" resultMap="CalculateRecordResult">
        <include refid="selectCalculateRecordVo"/>
        where id = #{id}
    </select>
    <insert id="insertCalculateRecord" parameterType="CalculateRecord">
        insert into t_calculate_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="date != null">date,</if>
            <if test="ruleId != null">rule_id,</if>
            <if test="unitId != null">unit_id,</if>
            <if test="totalMount != null">totalMount,</if>
            <if test="deductAmount != null">deduct_amount,</if>
            <if test="score != null">score,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="date != null">#{date},</if>
            <if test="ruleId != null">#{ruleId},</if>
            <if test="unitId != null">#{unitId},</if>
            <if test="totalMount != null">#{totalMount},</if>
            <if test="deductAmount != null">#{deductAmount},</if>
            <if test="score != null">#{score},</if>
         </trim>
    </insert>
    <update id="updateCalculateRecord">
        update t_calculate_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="date != null">date = #{date},</if>
            <if test="ruleId != null">rule_id = #{ruleId},</if>
            <if test="unitId != null">unit_id = #{unitId},</if>
            <if test="totalMount != null">totalMount = #{totalMount},</if>
            <if test="deductAmount != null">deduct_amount = #{deductAmount},</if>
            <if test="score != null">score = #{score},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteCalculateRecordById" >
        delete from t_calculate_record where id = #{id}
    </delete>
    <delete id="deleteCalculateRecordByIds" >
        delete from t_calculate_record where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
@@ -11,10 +11,11 @@
        <result property="parentId"    column="parent_id"    />
        <result property="unitId"    column="unit_id"    />
        <result property="value"    column="value"    />
        <result property="description"    column="description"    />
    </resultMap>
    <sql id="selectCalculateRuleVo">
        select id, name, template_id, parent_id, unit_id, value from t_calculate_rule
        select id, name, template_id, parent_id, unit_id, value, description from t_calculate_rule
    </sql>
    <select id="selectCalculateRuleList" resultMap="CalculateRuleResult">
@@ -22,16 +23,19 @@
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="templateId != null "> and template_id = #{templateId}</if>
            <if test="parentId != null "> and parent_id = #{parentId}</if>
            <if test="unitId != null "> and unit_id = #{unitId}</if>
            <if test="value != null "> and value = #{value}</if>
            <if test="description != null  and description != ''"> and description = #{description}</if>
        </where>
    </select>
    
    <select id="selectCalculateRuleById"  resultMap="CalculateRuleResult">
    <select id="selectCalculateRuleById" resultMap="CalculateRuleResult">
        <include refid="selectCalculateRuleVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertCalculateRule"  useGeneratedKeys="true" keyProperty="id">
    <insert id="insertCalculateRule" useGeneratedKeys="true" keyProperty="id">
        insert into t_calculate_rule
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="name != null">name,</if>
@@ -39,6 +43,7 @@
            <if test="parentId != null">parent_id,</if>
            <if test="unitId != null">unit_id,</if>
            <if test="value != null">value,</if>
            <if test="description != null">description,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="name != null">#{name},</if>
@@ -46,6 +51,7 @@
            <if test="parentId != null">#{parentId},</if>
            <if test="unitId != null">#{unitId},</if>
            <if test="value != null">#{value},</if>
            <if test="description != null">#{description},</if>
         </trim>
    </insert>
@@ -57,15 +63,16 @@
            <if test="parentId != null">parent_id = #{parentId},</if>
            <if test="unitId != null">unit_id = #{unitId},</if>
            <if test="value != null">value = #{value},</if>
            <if test="description != null">description = #{description},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteCalculateRuleById">
    <delete id="deleteCalculateRuleById" parameterType="Long">
        delete from t_calculate_rule where id = #{id}
    </delete>
    <delete id="deleteCalculateRuleByIds" >
    <delete id="deleteCalculateRuleByIds" parameterType="String">
        delete from t_calculate_rule where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}