暂存税率表接口
This commit is contained in:
parent
fb42a5f041
commit
87d278448c
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.cmd.TaxDeclaration;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.TaxRateBiz;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.DataUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxDeclarationDeleteCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxDeclarationDeleteCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
|
||||
List<String> idStrs = DataUtil.castList(params.get("ids"), String.class);
|
||||
if (CollectionUtils.isEmpty(idStrs)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
List<Long> ids = idStrs.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
TaxRateBiz taxRateBiz = new TaxRateBiz();
|
||||
|
||||
taxRateBiz.deleteByIds(ids);
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.engine.salary.cmd.TaxDeclaration;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxDeclarationListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxDeclarationListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
String pageID = "a4f85287-e3f9-4275-9527-7d06e54y6rj8";
|
||||
String pageUid = pageID + "_" + user.getUID();
|
||||
String pageSize = PageIdConst.getPageSize(pageID, user.getUID());
|
||||
|
||||
|
||||
String fileds = " create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time";
|
||||
String sql = " from hrsa_sys_tax_rate_base s " +
|
||||
" where s.delete_type = 0";
|
||||
//模糊查询
|
||||
String name = Util.null2String(params.get("name"));
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sql += " and s.name like '%" + name + "%' ";
|
||||
}
|
||||
sql += " union all " +
|
||||
" select create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time " +
|
||||
" from hrsa_tax_rate_base b " +
|
||||
" where b.delete_type = 0 ";
|
||||
//模糊查询
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sql += " and b.name like '%" + name + "%' ";
|
||||
}
|
||||
|
||||
WeaTable table = new WeaTable();
|
||||
table.setPageUID(pageUid);
|
||||
table.setPageID(pageID);
|
||||
table.setPagesize(pageSize);
|
||||
table.setBackfields(fileds);
|
||||
table.setSqlform(sql);
|
||||
// table.setSqlwhere();
|
||||
table.setSqlorderby("id desc");
|
||||
table.setSqlprimarykey("id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "name", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "systemType", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "createTime", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "名称", "description", ""));
|
||||
|
||||
//设置check是否可用
|
||||
table.setCheckboxList(null);
|
||||
table.setCheckboxpopedom(null);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
apidatas = result.getResultMap();
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.cmd.TaxDeclaration;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.TaxRateBiz;
|
||||
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxDeclarationSaveCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxDeclarationSaveCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
TaxRateBiz taxRateBiz = new TaxRateBiz();
|
||||
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
|
||||
taxRateBiz.save(taxRateSaveParam, (long) user.getUID());
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.cmd.TaxDeclaration;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.biz.TaxRateBiz;
|
||||
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxDeclarationUpdateCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxDeclarationUpdateCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
TaxRateBiz taxRateBiz = new TaxRateBiz();
|
||||
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
|
||||
taxRateBiz.update(taxRateSaveParam, (long) user.getUID());
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.engine.salary.entity.taxdeclaration;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 个税申报表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxDeclaration {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
private Date salaryMonth;
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
private Long taxAgentId;
|
||||
/**
|
||||
* 税款所属期
|
||||
*/
|
||||
private Date taxCycle;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.engine.salary.entity.taxdeclaration;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 个税申报表详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxDeclarationDetail {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private Long employeeId;
|
||||
/**
|
||||
* 字段code
|
||||
*/
|
||||
private String fieldCode;
|
||||
/**
|
||||
* 字段的值
|
||||
*/
|
||||
private String fieldValue;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 个税申报记录的id
|
||||
*/
|
||||
private Long taxDeclarationId;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.engine.salary.mapper.taxdeclaration;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaxDeclarationDetailMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxDeclarationDetail> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxDeclarationDetail getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param taxDeclarationDetail 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(TaxDeclarationDetail taxDeclarationDetail);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxDeclarationDetail 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxDeclarationDetail taxDeclarationDetail);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxDeclarationDetail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxDeclarationDetail taxDeclarationDetail);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxDeclarationDetail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxDeclarationDetail taxDeclarationDetail);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxDeclarationDetail 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxDeclarationDetail taxDeclarationDetail);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
<?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.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="employee_id" property="employeeId"/>
|
||||
<result column="field_code" property="fieldCode"/>
|
||||
<result column="field_value" property="fieldValue"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="tax_declaration_id" property="taxDeclarationId"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.employee_id
|
||||
, t.field_code
|
||||
, t.field_value
|
||||
, t.id
|
||||
, t.tax_declaration_id
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declaration_detail t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declaration_detail t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_declaration_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
employee_id,
|
||||
field_code,
|
||||
field_value,
|
||||
id,
|
||||
tax_declaration_id,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{employeeId},
|
||||
#{fieldCode},
|
||||
#{fieldValue},
|
||||
#{id},
|
||||
#{taxDeclarationId},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_declaration_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
employee_id,
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
field_code,
|
||||
</if>
|
||||
<if test="fieldValue != null">
|
||||
field_value,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taxDeclarationId != null">
|
||||
tax_declaration_id,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
#{employeeId},
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
#{fieldCode},
|
||||
</if>
|
||||
<if test="fieldValue != null">
|
||||
#{fieldValue},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="taxDeclarationId != null">
|
||||
#{taxDeclarationId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail">
|
||||
UPDATE hrsa_tax_declaration_detail
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
employee_id=#{employeeId},
|
||||
field_code=#{fieldCode},
|
||||
field_value=#{fieldValue},
|
||||
tax_declaration_id=#{taxDeclarationId},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail">
|
||||
UPDATE hrsa_tax_declaration_detail
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
employee_id=#{employeeId},
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
field_code=#{fieldCode},
|
||||
</if>
|
||||
<if test="fieldValue != null">
|
||||
field_value=#{fieldValue},
|
||||
</if>
|
||||
<if test="taxDeclarationId != null">
|
||||
tax_declaration_id=#{taxDeclarationId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail">
|
||||
UPDATE hrsa_tax_declaration_detail
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.engine.salary.mapper.taxdeclaration;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.TaxDeclaration;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaxDeclarationMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxDeclaration> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxDeclaration getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param taxDeclaration 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(TaxDeclaration taxDeclaration);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxDeclaration 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxDeclaration taxDeclaration);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxDeclaration 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxDeclaration taxDeclaration);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxDeclaration 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxDeclaration taxDeclaration);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxDeclaration 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxDeclaration taxDeclaration);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
<?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.engine.salary.mapper.taxdeclaration.TaxDeclarationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxdeclaration.TaxDeclaration">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="salary_month" property="salaryMonth"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="tax_cycle" property="taxCycle"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.description
|
||||
, t.id
|
||||
, t.salary_month
|
||||
, t.tax_agent_id
|
||||
, t.tax_cycle
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declaration t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declaration t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclaration"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_declaration
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
description,
|
||||
id,
|
||||
salary_month,
|
||||
tax_agent_id,
|
||||
tax_cycle,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{description},
|
||||
#{id},
|
||||
#{salaryMonth},
|
||||
#{taxAgentId},
|
||||
#{taxCycle},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclaration"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_declaration
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
salary_month,
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id,
|
||||
</if>
|
||||
<if test="taxCycle != null">
|
||||
tax_cycle,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
#{salaryMonth},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxCycle != null">
|
||||
#{taxCycle},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclaration">
|
||||
UPDATE hrsa_tax_declaration
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
description=#{description},
|
||||
salary_month=#{salaryMonth},
|
||||
tax_agent_id=#{taxAgentId},
|
||||
tax_cycle=#{taxCycle},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclaration">
|
||||
UPDATE hrsa_tax_declaration
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
salary_month=#{salaryMonth},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id=#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxCycle != null">
|
||||
tax_cycle=#{taxCycle},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxdeclaration.TaxDeclaration">
|
||||
UPDATE hrsa_tax_declaration
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -9,10 +9,10 @@ public interface TaxDeclarationService {
|
|||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> save(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> update(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationDeleteCmd;
|
||||
import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationListCmd;
|
||||
import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationSaveCmd;
|
||||
import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationUpdateCmd;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -9,22 +13,20 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> delete(Map<String, Object> params) {
|
||||
return null;
|
||||
return commandExecutor.execute(new TaxDeclarationListCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(Map<String, Object> params) {
|
||||
return null;
|
||||
return commandExecutor.execute(new TaxDeclarationSaveCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> update(Map<String, Object> params) {
|
||||
return null;
|
||||
return commandExecutor.execute(new TaxDeclarationUpdateCmd(params, user));
|
||||
}
|
||||
@Override
|
||||
public Map<String, Object> delete(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxDeclarationDeleteCmd(params, user));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue