Commit 6e44b2a5 by huluobin

update

parent e6bfd788
package com.blt.other.other_cost.dao;
import com.blt.other.other_cost.dto.CostTypeKindDto;
import com.blt.other.other_database.model.CostTypeDomain;
import com.blt.other.other_database.model.CostTypeKindDomain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -14,12 +13,14 @@ public interface CostTypeKindDao {
/**
* 获取所有费用种类
*
* @return
*/
List<CostTypeKindDomain> selectAll();
/**
* 根据 typeNo 获取费用种类
*
* @param typeNo
* @return
*/
......@@ -27,6 +28,7 @@ public interface CostTypeKindDao {
/**
* 根据 companyNo 获取费用种类
*
* @param companyNo
* @return
*/
......@@ -34,6 +36,7 @@ public interface CostTypeKindDao {
/**
* 根据 typeNo 和 kindName 获取费用种类,用于添加费用种类时判断是否已经存在相同的费用种类
*
* @param costTypeKindDomain
* @return
*/
......@@ -41,6 +44,7 @@ public interface CostTypeKindDao {
/**
* 根据 costTypeKindNo 获取种类信息
*
* @param costTypeKindNo
* @return
*/
......@@ -48,14 +52,27 @@ public interface CostTypeKindDao {
/**
* 根据费用小类名称和公司名称获取种类信息
*
* @param kindName
* @param companyName
* @return
*/
@Deprecated
CostTypeKindDomain selectByKindNameAndCompanyName(String kindName, String companyName);
/**
* <
*
* @param kindName
* @param companyNo
* @return
*/
CostTypeKindDomain selectByKindNameAndCompanyNo(@Param("kindName") String kindName, @Param("companyNo") String companyNo);
/**
* 新增费用种类记录
*
* @param ctkd
* @return
*/
......@@ -66,4 +83,5 @@ public interface CostTypeKindDao {
Integer update(CostTypeKindDomain costTypeKindDomain);
Integer delete(String kindNo);
}
......@@ -63,6 +63,9 @@ public class CostApiServiceImpl implements CostApiService {
@Autowired
CostLogDao costLogDao;
@Autowired
CostCompanyDao costCompanyDao;
@Override
@Transactional
public String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception {
......@@ -281,7 +284,9 @@ public class CostApiServiceImpl implements CostApiService {
sqlParam.setKindName("工资");
sqlParam.setCompanyName(wageCostDto.getCompanyName());
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNameAndCompanyName("工资", wageCostDto.getCompanyName());
CostCompanyDomain costCompany = costCompanyDao.selectByName(wageCostDto.getCompanyName());
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNameAndCompanyNo("工资", costCompany.getCompanyNo());
if (costTypeKindDomain == null) {
throw new RuntimeException(wageCostDto + "在费用系统不存在费用单小类:工资");
}
......
......@@ -3,85 +3,68 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.other_cost.dao.CostTypeKindDao">
<select id="selectAll" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
ORDER BY
id desc
SELECT *
FROM cost_type_kind
ORDER BY id desc
</select>
<select id="selectByTypeNo" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
type_no = #{typeNo}
SELECT *
FROM cost_type_kind
WHERE type_no = #{typeNo}
</select>
<select id="selectByCompanyNo" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
company_no = #{companyNo}
SELECT *
FROM cost_type_kind
WHERE company_no = #{companyNo}
</select>
<select id="selectByTypeNoAndKindName" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
type_no = #{typeNo}
AND
kind_name = #{kindName}
SELECT *
FROM cost_type_kind
WHERE type_no = #{typeNo}
AND kind_name = #{kindName}
</select>
<select id="selectByKindNo" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
kind_no = #{kindNo}
SELECT *
FROM cost_type_kind
WHERE kind_no = #{kindNo}
</select>
<select id="selectByKindNameAndCompanyName" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
kind_name = #{kindName}
AND
company_name = #{companyName}
SELECT *
FROM cost_type_kind
WHERE kind_name = #{kindName}
AND company_name = #{companyName}
</select>
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO
cost_type_kind(
kind_no,kind_name,type_no,type_name,company_no,company_name,cost_form,subject_code,is_lend,
create_username,create_usercode,cost_type_status
)
VALUE
(
#{kindNo},#{kindName},#{typeNo},#{typeName},#{companyNo},#{companyName},#{costForm},#{subjectCode},#{isLend},
#{createUsername},#{createUsercode},#{costTypeStatus}
)
INSERT INTO cost_type_kind(kind_no, kind_name, type_no, type_name, company_no, company_name, cost_form,
subject_code, is_lend,
create_username, create_usercode, cost_type_status)
VALUE
(
#{kindNo}, #{kindName}, #{typeNo}, #{typeName}, #{companyNo}, #{companyName}, #{costForm}, #{subjectCode},
#{isLend},
#{createUsername}, #{createUsercode}, #{costTypeStatus}
)
</insert>
<select id="selectByCompanyNoAndCostForm" resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT
*
FROM
cost_type_kind
WHERE
company_no = #{companyNo}
AND
cost_form = #{costForm}
SELECT *
FROM cost_type_kind
WHERE company_no = #{companyNo}
AND cost_form = #{costForm}
</select>
<select id="selectByKindNameAndCompanyNo"
resultType="com.blt.other.other_database.model.CostTypeKindDomain">
SELECT *
FROM cost_type_kind
WHERE kind_name = #{kindName}
AND company_no = #{companyNo}
</select>
<update id="update" parameterType="com.blt.other.other_database.model.CostTypeKindDomain">
......@@ -105,9 +88,8 @@
</update>
<delete id="delete">
DELETE FROM
cost_type_kind
WHERE
kind_no = #{kindNo}
DELETE
FROM cost_type_kind
WHERE kind_no = #{kindNo}
</delete>
</mapper>
\ No newline at end of file
</mapper>
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