<?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.TenantInfoMapper">
|
|
<select id=""></select>
|
|
<update id="updateTenanName">
|
UPDATE epc_user_info
|
SET userName = #{tenant.userName}
|
WHERE
|
openId = #{tenant.openId}
|
and tenantId = #{tenant.tenantId}
|
and companyId = #{tenant.companyId}
|
</update>
|
|
<select id="selectTenant" resultType="com.changhong.epc.bean.admin.TenantInfo">
|
select
|
id
|
`tenantId`,
|
`companyId`,
|
`language`,
|
`userName`,
|
`data_start`,
|
`ins_t`,
|
`upd_t`,
|
`ins_p`,
|
`upd_p`,
|
`openId`
|
from
|
epc_user_info
|
where openId = #{tenant.openId}
|
and tenantId = #{tenant.tenantId}
|
and companyId = #{tenant.companyId}
|
LIMIT 1
|
|
|
</select>
|
|
<select id="createTable" statementType="CALLABLE">
|
{call initCompany({tenantId}, {companyId})}
|
</select>
|
|
<select id="createView" statementType="CALLABLE">
|
{call initReport({tenantId}, {companyId})}
|
</select>
|
|
<update id="runSql" >
|
${sql}
|
</update>
|
|
<update id="dropFunction">
|
DROP FUNCTION IF EXISTS `getVal_{rule}`
|
</update>
|
|
<update id="createFunction" >
|
CREATE FUNCTION `getVal_{rule}`(`mdCode` varchar(100),`inMeCode` varchar(100),`outMeCode` varchar(100),`inMvCode` varchar(100))
|
RETURNS varchar(100) CHARSET utf8
|
BEGIN
|
DECLARE outVal varchar(100) DEFAULT '';
|
|
DECLARE rowNo INTEGER DEFAULT -1;
|
|
select
|
ROW_NO INTO rowNo
|
from epc_master_value_{rule}
|
where ELE_VALUE = inMvCode
|
and ELE_CODE = inMeCode
|
and DEFINE_CODE = mdCode
|
LIMIT 1;
|
|
select
|
ELE_VALUE INTO outVal
|
from epc_master_value_{rule}
|
where ROW_NO = rowNo
|
and ELE_CODE = outMeCode
|
and DEFINE_CODE = mdCode
|
LIMIT 1;
|
|
RETURN outVal;
|
END
|
</update>
|
|
<update id="initSysForm" >
|
update epc_system_config_{rule}
|
set cvalue = #{entry.value.code}
|
where ckey = #{entry.key}
|
</update>
|
|
</mapper>
|