Commit 4ed286a9 authored by hongguangwu's avatar hongguangwu

优化导入,精简字段

parent ef0d09f5
......@@ -27,7 +27,7 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
List<TSalaryAccountItem> getTSalaryAccountItemPage(@Param("tSalaryAccountItem") TSalaryAccountItem tSalaryAccountItem);
/**
* @param settleDepartId
* @param deptId
* @param settleMonth
* @param javaFiedName
* @Description: 获取报账详情信息
......@@ -35,7 +35,7 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
* @Date: 2019/9/29 18:26
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TSalaryAccountItem>
**/
List<TSalaryAccountItem> getAllTSalaryAccountItem(@Param("settleDepartId") String settleDepartId,
List<TSalaryAccountItem> getAllTSalaryAccountItem(@Param("deptId") String deptId,
@Param("settleMonth") String settleMonth, @Param("javaFiedName") String javaFiedName,
@Param("finallyYear") String finallyYear, @Param("empIdcard") String empIdcard,
@Param("accountId") String accountId);
......@@ -62,17 +62,17 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
List<TSalaryAccountItem> getAllItemVoList(@Param("idCardList") List<String> idCardList, @Param("invoiceTitle") String invoiceTitle);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取前几个月总工资
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.math.BigDecimal
**/
BigDecimal getAllMoney(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
BigDecimal getAllMoney(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
......@@ -97,45 +97,45 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
, @Param("javaFiedName") String javaFiedName);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取月份条数(前12个月平均工资,要除以工资月数,这里就是工资月数)
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.long.Integer
**/
Integer getAverageSalaryItemMonthCount(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
Integer getAverageSalaryItemMonthCount(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取前几个月总工资
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.math.BigDecimal
**/
BigDecimal getEngineerAllMoney(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
BigDecimal getEngineerAllMoney(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取月份条数(前12个月平均工资,要除以工资月数,这里就是工资月数)
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.long.Integer
**/
Integer getEngineerAverageSalaryItemMonthCount(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
Integer getEngineerAverageSalaryItemMonthCount(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
List<TSalaryAccountItem> getAccountItemList(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount
......
......@@ -71,8 +71,8 @@
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="settleMonth != null and settleMonth.trim() != ''">
AND a.SETTLEMENT_MONTH = #{settleMonth}
......@@ -124,14 +124,14 @@
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -150,19 +150,19 @@
<select id="getAverageSalaryItemMonthCount" resultType="Integer">
SELECT
count(DISTINCT a.SALARY_DATE)
count(DISTINCT a.SALARY_MONTH)
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -178,14 +178,14 @@
t_engineer_account_item i left join t_engineer_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -195,19 +195,19 @@
<select id="getEngineerAverageSalaryItemMonthCount" resultType="Integer">
SELECT
count(DISTINCT a.SALARY_DATE)
count(DISTINCT a.SALARY_MONTH)
FROM
t_engineer_account_item i left join t_engineer_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -272,8 +272,8 @@
<if test="tSalaryAccount.salaryFormId != null and tSalaryAccount.salaryFormId.trim() != ''">
AND a.SALARY_FORM_ID = #{tSalaryAccount.salaryFormId}
</if>
<if test="tSalaryAccount.salaryDate != null and tSalaryAccount.salaryDate.trim() != ''">
AND a.SALARY_DATE = #{tSalaryAccount.salaryDate}
<if test="tSalaryAccount.salaryMonth != null and tSalaryAccount.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryAccount.salaryMonth}
</if>
<if test="tSalaryAccount.empId != null and tSalaryAccount.empId.trim() != ''">
AND a.EMP_ID = #{tSalaryAccount.empId}
......@@ -284,14 +284,14 @@
<if test="tSalaryAccount.empNo != null and tSalaryAccount.empNo.trim() != ''">
AND a.EMP_NO = #{tSalaryAccount.empNo}
</if>
<if test="tSalaryAccount.settleDepartId != null and tSalaryAccount.settleDepartId.trim() != ''">
AND a.BELONG_DEPART = #{tSalaryAccount.settleDepartId}
<if test="tSalaryAccount.deptId != null and tSalaryAccount.deptId.trim() != ''">
AND a.BELONG_DEPART = #{tSalaryAccount.deptId}
</if>
<if test="tSalaryAccount.settleDepartNo != null and tSalaryAccount.settleDepartNo.trim() != ''">
AND a.SETTLE_DEPART_NO like '%${tSalaryAccount.settleDepartNo}%'
<if test="tSalaryAccount.deptNo != null and tSalaryAccount.deptNo.trim() != ''">
AND a.DEPT_NO like '%${tSalaryAccount.deptNo}%'
</if>
<if test="tSalaryAccount.settleDepartName != null and tSalaryAccount.settleDepartName.trim() != ''">
AND a.SETTLE_DEPART_NAME like '%${tSalaryAccount.settleDepartName}%'
<if test="tSalaryAccount.deptName != null and tSalaryAccount.deptName.trim() != ''">
AND a.DEPT_NAME like '%${tSalaryAccount.deptName}%'
</if>
<if test="tSalaryAccount.empIdcard != null and tSalaryAccount.empIdcard.trim() != ''">
AND a.EMP_IDCARD like '%${tSalaryAccount.empIdcard}%'
......@@ -392,25 +392,9 @@
</if>
</if>
</sql>
<!--tSalaryAccountItem简单分页查询-->
<select id="getTSalaryAccountItemPage" resultMap="tSalaryAccountItemMap">
SELECT
a.SALARY_ACCOUNT_ID as 'key',
a.SALARY_MONEY as 'value'
FROM
t_salary_account_item a
WHERE
a.SALARY_ACCOUNT_ID IN
<foreach item="item" index="index" collection="account" open="(" separator="," close=")">
#{item.id}
</foreach>
and
a.JAVA_FIED_NAME='actualSalarySum'
</select>
<!-- 获取工资明细 -->
<select id="getItemSet" resultType="java.lang.String">
select
i.cn_name a
from t_salary_account_item i
......@@ -421,70 +405,6 @@
order by i.JAVA_FIED_NAME desc,i.id
</select>
<!-- 获取所有数据,组装map,工资导入使用 -->
<select id="getAllItemVoList" resultMap="itemVoMap">
SELECT
i.ID,
i.SALARY_ACCOUNT_ID,
i.CN_NAME,
i.JAVA_FIED_NAME,
i.SALARY_MONEY,
i.TEXT_VALUE,
i.IS_TAX,
a.EMP_IDCARD,
a.SETTLEMENT_MONTH,
a.SALARY_TYPE
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.SETTLEMENT_MONTH like DATE_FORMAT(now(),"%Y%")
<if test="idCardList != null">
AND a.EMP_IDCARD in
<foreach item="item" index="index" collection="idCardList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceTitle != null and invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{invoiceTitle}
</if>
AND a.DELETE_FLAG = 0 and a.SALARY_TYPE != 7
</where>
</select>
<select id="getAllTSalaryAccountItem" resultMap="tSalaryAccountItemMap">
SELECT
i.ID,
i.SALARY_ACCOUNT_ID,
i.CN_NAME,
i.JAVA_FIED_NAME,
i.SALARY_MONEY,
i.TEXT_VALUE,
i.IS_TAX
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
</if>
<if test="settleMonth != null and settleMonth.trim() != ''">
AND a.SETTLEMENT_MONTH = #{settleMonth}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="finallyYear != null and finallyYear.trim() != ''">
AND a.SETTLEMENT_MONTH like concat(#{finallyYear}, '%')
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
</if>
<if test="accountId != null and accountId.trim() != ''">
AND a.id != #{accountId}
</if>
</where>
</select>
<!-- 获取所有数据,组装map,工资导入使用 -->
<select id="getAllItemVoList" resultMap="itemVoMap">
SELECT
......
......@@ -113,7 +113,7 @@
<select id="getTAttaPage" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
......@@ -125,11 +125,11 @@
<select id="getTAttaList" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
</where>
order by CREATE_TIME
order by CREATE_TIME desc
</select>
</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