Commit 84e2d41d by huluobin

mp 和xml重名方法 去除

parent 6163cebe
......@@ -19,4 +19,6 @@ public class CostAttach {
@ApiModelProperty("附加字段值")
private String value;
private String type;
}
......@@ -10,7 +10,7 @@ import java.util.List;
public interface CostPlanDao extends BaseMapper<CostPlanDomain> {
CostPlanDomain selectByNo(String costPlanNo);
CostPlanDomain selectByNo(String planNo);
/**
* <p>
......@@ -33,4 +33,5 @@ public interface CostPlanDao extends BaseMapper<CostPlanDomain> {
Integer deleteByNo(String costPlanNo);
List<CostPlanDomain> selectAll(@Param("userId") Integer userId);
}
......@@ -19,6 +19,7 @@ import org.springframework.beans.BeanUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Accessors(chain = true)
@TableName(value = "cost_plan", autoResultMap = true)
......@@ -138,7 +139,7 @@ public class CostPlanDomain implements Serializable {
@TableField(value = "`attach`", typeHandler = JacksonTypeHandler.class)
@ApiModelProperty("附加字段")
private CostAttach attach;
private List<CostAttach> attach;
@ApiModelProperty("费用模版id")
private Integer costTemplateId;
......
......@@ -3,6 +3,12 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.module.cost.dao.CostDao">
<resultMap id="cost" type="com.blt.other.module.cost.model.CostDomain">
<result column="attach" jdbcType="VARCHAR" property="attach"
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
</resultMap>
<select id="selectAll" resultType="com.blt.other.module.cost.model.CostDomain">
SELECT
*
......@@ -21,7 +27,7 @@
id DESC
</select>
<select id="selectByCostNo" resultType="com.blt.other.module.cost.model.CostDomain">
<select id="selectByCostNo" resultMap="cost">
SELECT *
FROM cost
WHERE cost_no = #{costNo}
......@@ -94,7 +100,7 @@
cost_no = #{costNo}
</update>
<select id="selectByStatus" resultType="com.blt.other.module.cost.model.CostDomain">
<select id="selectByStatus" resultMap="cost">
SELECT *
FROM cost
WHERE cost_status >= #{costStatus}
......
......@@ -2,7 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.module.cost.dao.CostPlanDao">
<select id="selectByNo" resultType="com.blt.other.module.database.model.CostPlanDomain">
<resultMap id="costPlan" type="com.blt.other.module.database.model.CostPlanDomain">
<result column="attach" jdbcType="VARCHAR" property="attach"
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
</resultMap>
<select id="selectByNo" resultMap="costPlan">
SELECT *
FROM cost_plan
WHERE cost_plan_no = #{costPlanNo}
......@@ -64,7 +69,7 @@
WHERE cost_plan_no = #{costPlanNo}
</delete>
<select id="selectAll" resultType="com.blt.other.module.database.model.CostPlanDomain">
<select id="selectAll" resultMap="costPlan">
SELECT
*
FROM
......
......@@ -3,6 +3,7 @@ package com.blt.other.module.cost.dao;
import com.bailuntec.cost.api.dto.CostAttach;
import com.blt.other.OtherApplication;
import com.blt.other.module.database.model.CostPlanDomain;
import com.google.common.collect.Lists;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
......@@ -30,11 +31,11 @@ public class CostPlanDaoTest {
@Test
public void insert() {
CostPlanDomain costPlanDomain = new CostPlanDomain();
CostAttach costAttach = new CostAttach();
costAttach.setName("sda");
costPlanDomain.setAttach(costAttach);
costPlanDomain.setAttach(Lists.newArrayList());
costPlanDomain.setCostPlanStatus(1);
costPlanDao.insert(costPlanDomain);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment