Commit 6721e693 by huluobin

update

parent cb969661
...@@ -9,6 +9,9 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -9,6 +9,9 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
@Repository @Repository
public interface CostTypeDao extends BaseMapper<CostTypeDomain> { public interface CostTypeDao extends BaseMapper<CostTypeDomain> {
...@@ -28,4 +31,6 @@ public interface CostTypeDao extends BaseMapper<CostTypeDomain> { ...@@ -28,4 +31,6 @@ public interface CostTypeDao extends BaseMapper<CostTypeDomain> {
//根据费用类型名称和类型查询 //根据费用类型名称和类型查询
CostTypeDomain selectByNameAndType(@Param("name") String name, @Param("type") Integer type); CostTypeDomain selectByNameAndType(@Param("name") String name, @Param("type") Integer type);
List<CostTypeDomain> selectTestType();
} }
...@@ -40,6 +40,16 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -40,6 +40,16 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType())); costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType()));
this.save(costTypeDomain); this.save(costTypeDomain);
if (req.getType().equals(1)) {
CostTypeDomain lendCostTypeDomain = new CostTypeDomain();
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow);
lendCostTypeDomain.setAccountingSubjectNo("1345912843756503041");
lendCostTypeDomain.setTypeNo(IdWorker.getIdStr());
lendCostTypeDomain.setTypeName(req.getTypeName());
lendCostTypeDomain.setDescription(req.getDescription());
}
} }
@Override @Override
......
...@@ -71,5 +71,12 @@ ...@@ -71,5 +71,12 @@
where cost_template_type = #{type} where cost_template_type = #{type}
and type_name = #{name} and type_name = #{name}
</select> </select>
<select id="selectTestType" resultType="com.blt.other.database.model.CostTypeDomain">
SELECT t1.* from cost_type t1
LEFT JOIN cost_type t2 on t1.type_name =t2.type_name and t2.cost_template_type = 2
where t1.cost_template_type = 9 and t2.id is null;
</select>
</mapper> </mapper>
...@@ -364,8 +364,7 @@ public class OtherApplicationTests { ...@@ -364,8 +364,7 @@ public class OtherApplicationTests {
@Rollback(value = false) @Rollback(value = false)
@Test @Test
public void testType() { public void testType() {
costTypeDao.selectList(new LambdaQueryWrapper<CostTypeDomain>() costTypeDao.selectTestType()
.eq(CostTypeDomain::getCostTemplateType, CostTypeDomain.feeType))
.forEach(costTypeDomain -> { .forEach(costTypeDomain -> {
CostTypeDomain item = new CostTypeDomain(); CostTypeDomain item = new CostTypeDomain();
item.setCostTemplateType(CostTypeDomain.borrow); item.setCostTemplateType(CostTypeDomain.borrow);
......
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