New file |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * æ ¸ç®è§å对象 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") |
| | |
| | | /** æ¯å°1%æ£å½ææ»æå¡è´¹çå¤å° */ |
| | | @Excel(name = "æ¯å°1%æ£å½ææ»æå¡è´¹çå¤å°") |
| | | private BigDecimal value; |
| | | |
| | | /** $column.columnComment */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String description; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | |
| | | { |
| | | return templateId; |
| | | } |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | public void setUnitId(Long unitId) |
| | | { |
| | | this.unitId = unitId; |
| | |
| | | { |
| | | return value; |
| | | } |
| | | public void setDescription(String description) |
| | | { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getDescription() |
| | | { |
| | | return description; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | |
| | | .append("parentId", getParentId()) |
| | | .append("unitId", getUnitId()) |
| | | .append("value", getValue()) |
| | | .append("description", getDescription()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | * æ ¸ç®è§åController |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-03 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/check/calculateRule") |
| | | @RequestMapping("/calculate/rule") |
| | | public class CalculateRuleController extends BaseController |
| | | { |
| | | @Autowired |
| | |
| | | /** |
| | | * æ¥è¯¢æ ¸ç®è§åå表 |
| | | */ |
| | | @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) |
| | |
| | | /** |
| | | * è·åæ ¸ç®è§å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:query')") |
| | | @PreAuthorize("@ss.hasPermi('calculate:rule:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | /** |
| | | * æ°å¢æ ¸ç®è§å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:add')") |
| | | @PreAuthorize("@ss.hasPermi('calculate:rule:add')") |
| | | @Log(title = "æ ¸ç®è§å", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody CalculateRule calculateRule) |
| | |
| | | /** |
| | | * ä¿®æ¹æ ¸ç®è§å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:rule:edit')") |
| | | @PreAuthorize("@ss.hasPermi('calculate:rule:edit')") |
| | | @Log(title = "æ ¸ç®è§å", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody CalculateRule calculateRule) |
| | |
| | | /** |
| | | * å 餿 ¸ç®è§å |
| | | */ |
| | | @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) |
New file |
| | |
| | | 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); |
| | | } |
| | |
| | | * æ ¸ç®è§åMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-03 |
| | | */ |
| | | public interface CalculateRuleMapper |
| | | { |
New file |
| | |
| | | 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); |
| | | } |
| | |
| | | * æ ¸ç®è§åServiceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-03 |
| | | */ |
| | | public interface ICalculateRuleService |
| | | { |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | * æ ¸ç®è§åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | * @date 2024-04-03 |
| | | */ |
| | | @Service |
| | | public class CalculateRuleServiceImpl implements ICalculateRuleService |
New file |
| | |
| | | <?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> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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} |