Commit 84e2d41d by huluobin

mp 和xml重名方法 去除

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