|
@@ -94,19 +94,77 @@
|
|
|
</update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
- <delete id="delete">
|
|
|
+ <update id="delete">
|
|
|
UPDATE charge_type SET del_flag_ = 1 WHERE id_ = #{id}
|
|
|
- </delete>
|
|
|
+ </update>
|
|
|
+ <update id="batchDel">
|
|
|
+ UPDATE charge_type SET del_flag_ = 1 WHERE FIND_IN_SET(id_,#{ids})
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <sql id="queryPageSql">
|
|
|
+ <where>
|
|
|
+ fe.del_flag_ = 0
|
|
|
+ <if test="batchNo != null and batchNo != ''">
|
|
|
+ AND fe.batch_no_ = #{batchNo}
|
|
|
+ </if>
|
|
|
+ <if test="financialProcessNo != null and financialProcessNo != ''">
|
|
|
+ AND fe.financial_process_no_ = #{financialProcessNo}
|
|
|
+ </if>
|
|
|
+ <if test="dingtalkProcessNo != null and dingtalkProcessNo != ''">
|
|
|
+ AND fe.dingtalk_process_no_ = #{dingtalkProcessNo}
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ AND fe.organ_id_ = #{organId}
|
|
|
+ </if>
|
|
|
+ <if test="cooperationOrganId != null">
|
|
|
+ AND fe.cooperation_organ_id_ = #{cooperationOrganId}
|
|
|
+ </if>
|
|
|
+ <if test="applyUserId != null">
|
|
|
+ AND fe.apply_user_id_ = #{applyUserId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND DATE_FORMAT(fe.payment_time_,'%Y%m%d') >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND DATE_FORMAT(fe.payment_time_,'%Y%m%d') <= #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="FinancialExpenditure" parameterType="map">
|
|
|
- SELECT * FROM financial_expenditure
|
|
|
- WHERE del_flag_ = 0
|
|
|
+ SELECT fe.*,o.name_ organ_name_,co.name_ cooperation_name_,su.real_name_
|
|
|
+ FROM financial_expenditure fe
|
|
|
+ LEFT JOIN organization o ON o.id_ = fe.organ_id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = fe.apply_user_id_
|
|
|
+ LEFT JOIN cooperation_organ co ON co.id_ = fe.cooperation_organ_id_
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM financial_expenditure WHERE del_flag_ = 0
|
|
|
+ SELECT COUNT(DISTINCT fe.id_) FROM financial_expenditure fe
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
</select>
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.dto.FinancialExpenditureDto" id="FinancialExpenditureDto" extends="FinancialExpenditure">
|
|
|
+ <result column="organ_name_" property="organName"/>
|
|
|
+ <result column="cooperation_name_" property="cooperationName"/>
|
|
|
+ <result column="real_name_" property="realName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="findFinancialExpenditureCount" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(DISTINCT fe.id_) FROM financial_expenditure fe
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
+ </select>
|
|
|
+ <select id="queryFinancialExpenditurePage" resultMap="FinancialExpenditureDto">
|
|
|
+ SELECT fe.*,o.name_ organ_name_,co.name_ cooperation_name_,su.real_name_
|
|
|
+ FROM financial_expenditure fe
|
|
|
+ LEFT JOIN organization o ON o.id_ = fe.organ_id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = fe.apply_user_id_
|
|
|
+ LEFT JOIN cooperation_organ co ON co.id_ = fe.cooperation_organ_id_
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
</mapper>
|