<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!-- Table:epc_system_math_{rule} -->
|
<mapper namespace="com.changhong.epc.count.mapper.tenant.system.SystemMathMapper">
|
<resultMap id="systemMathMapperResultMap" type="com.changhong.epc.bean.count.system.SystemMathExtend">
|
<id column="m_id" property="id" />
|
<result property="name" column="name"/><!-- 公式显示名称 -->
|
<result property="count" column="count"/><!-- 公式计算内容 -->
|
<result property="view" column="view"/><!-- 展现的公式编辑内容 -->
|
<result property="type" column="type"/><!-- 10:计算公式20:取值公式 -->
|
<result property="resultFromat" column="result_fromat"/><!-- 公式结果格式10:数值20:布尔 -->
|
<result property="groupId" column="group_id"/><!-- 公式组,如:计算函数组,逻辑函数组,分支函数组 -->
|
<collection property="systemMathParam" ofType="com.changhong.epc.bean.count.system.SystemMathParam">
|
<!-- <result property="mathId" column="math_id"/>系统函数公式id
|
--> <result property="mdCode" column="md_code"/><!-- 主数据code -->
|
<result property="meCode" column="me_code"/><!-- 元素标识符 -->
|
<result property="joinMathId" column="join_math_id"/><!-- 引用公式id -->
|
<result property="defVal" column="def_val"/><!-- 默认值 -->
|
<result property="pType" column="p_type"/><!-- 10:值类型,20:公式类型 -->
|
<result property="pIndex" column="p_index"/><!-- 数据序号 -->
|
<result property="mdName" column="md_name"/>
|
<result property="meName" column="me_name"/>
|
</collection>
|
|
</resultMap>
|
<sql id="systemMathSql">
|
T1.id m_id, name, count, view, type, result_fromat
|
, group_id
|
</sql>
|
<sql id="systemMathParamSql">
|
math_id, md_code, me_code, join_math_id, def_val
|
, p_type, p_index, md_name, me_name
|
</sql>
|
<select id="selectSystemSystemMathExtendById" resultType="int" resultMap="systemMathMapperResultMap">
|
select
|
<include refid="systemMathSql" />,
|
<include refid="systemMathParamSql"/>
|
from epc_system_math_{rule} T1
|
LEFT JOIN epc_system_math_param_{rule} T2 on
|
T1.id = T2.math_id
|
WHERE
|
T1.id = #{mid}
|
</select>
|
|
<select id="selectCountBudget" resultType="java.lang.Integer">
|
SELECT
|
count(*)
|
FROM
|
${formName}
|
WHERE
|
DELETEFLG = 0
|
AND ${numberKey} !=#{number}
|
AND reimburseMan = #{man}
|
AND DATE_FORMAT(budgetStartDate,'%Y-%m') = DATE_FORMAT(#{date},'%Y-%m')
|
</select>
|
<!--
|
AND DATE(budgetStartDate) <= last_day(curdate())
|
AND DATE(budgetStartDate) >= date_add(curdate(),interval -day(curdate())+1 day)
|
-->
|
|
</mapper>
|