<?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" >
|
<mapper namespace="com.changhong.epc.tenant.mapper.tenant.system.math.SystemMathMapper">
|
|
<sql id="systemMathFiled">
|
a.id aId, a.name aName, a.count aCount , a.view aView, a.type aType
|
, a.result_fromat aResult, a.group_id aGroup
|
</sql>
|
|
<sql id="systemMathParamFiled">
|
b.id bId, b.math_id bMath, b.md_code bMdCode, b.me_code bMeCode, b.join_math_id bJoin
|
, b.def_val bDef, b.p_type bPType, b.p_index bIndex, b.md_name bMdName, b.me_name bMeName
|
</sql>
|
|
<resultMap type="com.changhong.epc.bean.count.system.SystemMathExtend" id="systemMathExtendMap">
|
<id property="id" column="aId"/>
|
<result property="name" column="aName"/>
|
<result property="count" column="aCount"/>
|
<result property="view" column="aView"/>
|
<result property="type" column="aType"/>
|
<result property="resultFromat" column="aResult"/>
|
<result property="groupId" column="aGroup"/>
|
<collection property="systemMathParam" ofType="com.changhong.epc.bean.count.system.SystemMathParam">
|
<id property="id" column="bId"/>
|
<result property="mathId" column="bMath"/>
|
<result property="mdCode" column="bMdCode"/>
|
<result property="meCode" column="bMeCode"/>
|
<result property="joinMathId" column="bJoin"/>
|
<result property="defVal" column="bDef"/>
|
<result property="pType" column="bPType"/>
|
<result property="pIndex" column="bIndex"/>
|
<result property="mdName" column="bMdName"/>
|
<result property="meName" column="bMeName"/>
|
</collection>
|
</resultMap>
|
|
<resultMap type="com.changhong.epc.bean.count.system.SystemMath" id="systemMathNameMap">
|
<id property="id" column="aId"/>
|
<result property="name" column="aName"/>
|
</resultMap>
|
|
<select id="selectSystemMathNameList" resultMap="systemMathNameMap">
|
select
|
a.id aId, a.name aName
|
from
|
epc_system_math_{rule} a
|
</select>
|
|
<select id="selectAllSystemMathExtend" resultMap="systemMathExtendMap">
|
select
|
<include refid="systemMathFiled"/>,
|
<include refid="systemMathParamFiled"/>
|
FROM
|
epc_system_math_{rule} a
|
LEFT JOIN epc_system_math_param_{rule} b ON b.math_id = a.id
|
ORDER BY a.id DESC, b.p_index
|
</select>
|
|
<insert id="save" parameterType="com.changhong.epc.bean.count.system.SystemMathExtend"
|
useGeneratedKeys="true" keyProperty="sys.id">
|
insert into epc_system_math_{rule} (id,name,count,view,type,result_fromat,group_id,data_start,ins_p,ins_t,upd_p,upd_t)
|
values
|
(null,#{sys.name},#{sys.count},#{sys.view},#{sys.type},#{sys.resultFromat},#{sys.groupId},#{sys.dataStart},#{sys.insP},#{sys.insT},#{sys.updP},#{sys.updT})
|
</insert>
|
|
<select id="getCostTypeByFormId" resultType="map">
|
|
select f_name,type from epc_cost_from_mapping_${tenantId}_${companyId}
|
where f_id = #{formId}
|
and ct_id =
|
(select C_type from formdata_${tenantId}_${formId} where datarownum = #{dataRowNum} limit 1)
|
limit 1
|
</select>
|
|
</mapper>
|