Commit d6207295 authored by neo's avatar neo

[dev] fix oracle xml

parent d16cb20f
...@@ -107,7 +107,5 @@ public interface CellTemplateMapper extends MyMapper { ...@@ -107,7 +107,5 @@ public interface CellTemplateMapper extends MyMapper {
*/ */
int updateByPrimaryKey(CellTemplate record); int updateByPrimaryKey(CellTemplate record);
void batchInsert(List<CellTemplate> list);
void batchInsert2(List<CellTemplate> list); void batchInsert2(List<CellTemplate> list);
} }
\ No newline at end of file
...@@ -115,8 +115,6 @@ public interface OrganizationMapper extends MyMapper { ...@@ -115,8 +115,6 @@ public interface OrganizationMapper extends MyMapper {
@Select("SELECT id, ParentID from Organization") @Select("SELECT id, ParentID from Organization")
List<OrganizationDto> selectOnlyIdAndParentId(); List<OrganizationDto> selectOnlyIdAndParentId();
Organization selectByPrimaryKeyWithAssociation(String id);
List<Organization> selectByExampleWithAssociation(OrganizationExample example); List<Organization> selectByExampleWithAssociation(OrganizationExample example);
List<OrganizationDto> selectIndBusiunitAreaOrgstrct(@Param("orgIsActive") Boolean orgIsActive); List<OrganizationDto> selectIndBusiunitAreaOrgstrct(@Param("orgIsActive") Boolean orgIsActive);
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.AreaRegionMapper"> <mapper namespace="pwc.taxtech.atms.dao.AreaRegionMapper">
<!-- User defined --> <!-- User defined -->
<resultMap id="ResultMapWithAreaAndRegion" type="pwc.taxtech.atms.entity.AreaRegion"> <resultMap id="ResultMapWithAreaAndRegion" type="pwc.taxtech.atms.entity.AreaRegion">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="areaRegionAreaID" jdbcType="VARCHAR" property="areaID"/> <result column="AREA_REGION_AREA_ID" jdbcType="VARCHAR" property="areaId"/>
<result column="areaRegionRegionID" jdbcType="VARCHAR" property="regionID"/> <result column="AREA_REGION_REGION_ID" jdbcType="VARCHAR" property="regionId"/>
<association column="AreaID" javaType="pwc.taxtech.atms.entity.Area" property="area"> <association column="AREA_ID" javaType="pwc.taxtech.atms.entity.Area" property="area">
<id column="areaID" property="ID"/> <id column="AREA_ID" property="ID"/>
<result column="areaParentID" property="parentId"/> <result column="AREA_PARENT_ID" property="parentId"/>
<result column="areaName" property="name"/> <result column="AREA_NAME" property="name"/>
<result column="areaIsActive" property="isActive"/> <result column="AREA_IS_ACTIVE" property="isActive"/>
</association> </association>
<association column="RegionID" javaType="pwc.taxtech.atms.entity.Region" property="region"> <association column="REGION_ID" javaType="pwc.taxtech.atms.entity.Region" property="region">
<id column="regionID" property="ID"/> <id column="REGION_ID" property="ID"/>
<result column="regionParentID" property="parentId"/> <result column="REGION_PARENT_ID" property="parentId"/>
<result column="regionName" property="name"/> <result column="REGION_NAME" property="name"/>
<result column="regionShortName" property="shortName"/> <result column="REGION_SHORT_NAME" property="shortName"/>
<result column="regionMergerName" property="mergerName"/> <result column="REGION_MERGER_NAME" property="mergerName"/>
<result column="regionLevelType" property="levelType"/> <result column="REGION_LEVEL_TYPE" property="levelType"/>
<result column="regionTelCode" property="telCode"/> <result column="REGION_TEL_CODE" property="telCode"/>
<result column="regionZipCode" property="zipCode"/> <result column="REGION_ZIP_CODE" property="zipCode"/>
<result column="regionPinYin" property="pinYin"/> <result column="REGION_PIN_YIN" property="pinYin"/>
<result column="regionLongitude" property="longitude"/> <result column="REGION_LONGITUDE" property="longitude"/>
<result column="regionLatitude" property="latitude"/> <result column="REGION_LATITUDE" property="latitude"/>
<result column="regionIsActive" property="isActive"/> <result column="REGION_IS_ACTIVE" property="isActive"/>
</association> </association>
</resultMap> </resultMap>
<select id="selectAreaRegionByAreaId" parameterType="string" resultMap="ResultMapWithAreaAndRegion"> <select id="selectAreaRegionByAreaId" parameterType="string" resultMap="ResultMapWithAreaAndRegion">
select SELECT
AreaRegion.ID, AreaRegion.AreaID as areaRegionAreaID, AreaRegion.RegionID as areaRegionRegionID AREA_REGION.ID,
, Area.ID as areaID, Area.ParentID as areaParentID, Area.Name as areaName, Area.IsActive as areaIsActive AREA_REGION.AREA_ID AS AREA_REGION_AREA_ID,
, Region.ID as regionID, Region.ParentID as regionParentID, Region.Name as regionName, Region.ShortName as AREA_REGION.REGION_ID AS AREA_REGION_REGION_ID,
regionShortName, Region.MergerName as regionMergerName, Region.LevelType as regionLevelType, Region.TelCode as AREA.ID AS AREA_ID,
regionTelCode, Region.ZipCode as regionZipCode, Region.PinYin as regionPinYin, Region.Longitude as AREA.PARENT_ID AS AREA_PARENT_ID,
RegionLongitude, Region.Latitude as regionLatitude, Region.IsActive as regionIsActive AREA.NAME AS AREA_NAME,
from AREA.IS_ACTIVE AS AREA_IS_ACTIVE,
AreaRegion, Area, Region REGION.ID AS REGION_ID,
where REGION.PARENT_ID AS REGION_PARENT_ID,
AreaRegion.areaID = Area.ID REGION.NAME AS REGION_NAME,
and AreaRegion.regionID = Region.ID REGION.SHORT_NAME AS REGION_SHORT_NAME,
and AreaRegion.areaID = #{areaId} REGION.MERGER_NAME AS REGION_MERGER_NAME,
order by regionID REGION.LEVEL_TYPE AS REGION_LEVEL_TYPE,
REGION.TEL_CODE AS REGION_TEL_CODE,
REGION.ZIP_CODE AS REGION_ZIP_CODE,
REGION.PIN_YIN AS REGION_PIN_YIN,
REGION.LONGITUDE AS REGION_LONGITUDE,
REGION.LATITUDE AS REGION_LATITUDE,
REGION.IS_ACTIVE AS REGION_IS_ACTIVE
FROM
AREA_REGION,
AREA,
REGION
WHERE
AREA_REGION.AREA_ID = AREA.ID
AND AREA_REGION.REGION_ID = REGION.ID
AND AREA_REGION.AREA_ID = #{areaId}
ORDER BY
REGION_ID
</select> </select>
<resultMap id="resultMapAreaRegionDto" type="pwc.taxtech.atms.dto.arearegion.AreaRegionDto"> <resultMap id="resultMapAreaRegionDto" type="pwc.taxtech.atms.dto.arearegion.AreaRegionDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="AreaID" property="areaID"/> <result column="AREA_ID" property="areaId"/>
<result column="RegionName" property="regionName"/> <result column="REGION_NAME" property="regionName"/>
<result column="RegionID" property="regionID"/> <result column="REGION_ID" property="regionId"/>
</resultMap> </resultMap>
<select id="selectByRegionLevelType" parameterType="map" resultMap="resultMapAreaRegionDto"> <select id="selectByRegionLevelType" parameterType="map" resultMap="resultMapAreaRegionDto">
select areaRegionReal.AreaID as AreaID, SELECT
p.Name as RegionName, AREA_REGION_REAL.AREA_ID AS AREA_ID,
p.ID as RegionID p.NAME AS REGION_NAME,
from Region as p p.ID AS REGION_ID
left join AreaRegion as areaRegionReal FROM
on p.ID = areaRegionReal.RegionID REGION AS P
where p.LevelType = #{regionLevelType} LEFT JOIN
AREA_REGION AS AREA_REGION_REAL
ON
p.ID = AREA_REGION_REAL.REGION_ID
WHERE
p.LEVEL_TYPE = #{regionLevelType}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.BusinessUnitMapper"> <mapper namespace="pwc.taxtech.atms.dao.BusinessUnitMapper">
<resultMap id="OrganizationDto" type="pwc.taxtech.atms.dpo.OrganizationDto"> <resultMap id="OrganizationDto" type="pwc.taxtech.atms.dpo.OrganizationDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="OrganizationName" jdbcType="VARCHAR" property="name"/> <result column="ORGANIZATION_NAME" jdbcType="VARCHAR" property="name"/>
<result column="IndustryName" jdbcType="VARCHAR" property="industryName"/> <result column="INDUSTRY_NAME" jdbcType="VARCHAR" property="industryName"/>
<result column="BusinessUnitName" jdbcType="VARCHAR" property="businessUnitName"/> <result column="BUSINESS_UNIT_NAME" jdbcType="VARCHAR" property="businessUnitName"/>
<result column="BusinessUnitID" jdbcType="VARCHAR" property="businessUnitID"/> <result column="BUSINESS_UNIT_ID" jdbcType="VARCHAR" property="businessUnitId"/>
<result column="OrgStructureName" jdbcType="VARCHAR" property="structureName"/> <result column="ORG_STRUCTURE_NAME" jdbcType="VARCHAR" property="structureName"/>
<result column="IndustryID" jdbcType="VARCHAR" property="industryID"/> <result column="INDUSTRY_ID" jdbcType="VARCHAR" property="industryId"/>
<result column="RegionID" jdbcType="VARCHAR" property="regionID"/> <result column="REGION_ID" jdbcType="VARCHAR" property="regionId"/>
<result column="RegionName" jdbcType="VARCHAR" property="regionName"/> <result column="REGION_NAME" jdbcType="VARCHAR" property="regionName"/>
<result column="OrgStructureID" jdbcType="VARCHAR" property="structureID"/> <result column="ORG_STRUCTURE_ID" jdbcType="VARCHAR" property="structureId"/>
<result column="AreaID" jdbcType="VARCHAR" property="areaID"/> <result column="AREA_ID" jdbcType="VARCHAR" property="areaId"/>
<result column="AreaName" jdbcType="VARCHAR" property="areaName"/> <result column="AREA_NAME" jdbcType="VARCHAR" property="areaName"/>
<result column="ClientCode" jdbcType="VARCHAR" property="clientCode"/> <result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode"/>
<result column="Code" jdbcType="VARCHAR" property="code"/> <result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="ParentID" jdbcType="VARCHAR" property="parentId"/> <result column="PARENT_ID" jdbcType="VARCHAR" property="parentId"/>
<result column="PLevel" jdbcType="INTEGER" property="pLevel"/> <result column="P_LEVEL" jdbcType="INTEGER" property="pLevel"/>
<result column="TaxPayerNumber" jdbcType="VARCHAR" property="taxPayerNumber"/> <result column="TAX_PAYER_NUMBER" jdbcType="VARCHAR" property="taxPayerNumber"/>
<result column="IsActive" jdbcType="SMALLINT" property="isActive"/> <result column="IS_ACTIVE" jdbcType="SMALLINT" property="isActive"/>
</resultMap> </resultMap>
<select id="getBusinessUnitListJoinResult" resultMap="OrganizationDto"> <select id="getBusinessUnitListJoinResult" resultMap="OrganizationDto">
select Distinct org.ID as ID, SELECT DISTINCT
org.Name as OrganizationName, ORG.ID AS ID,
ind.Name as IndustryName, ORG.NAME AS ORGANIZATION_NAME,
bu.Name as BusinessUnitName, IND.NAME AS INDUSTRY_NAME,
bu.ID as BusinessUnitID, BU.NAME AS BUSINESS_UNIT_NAME,
os.Name as OrgStructureName, BU.ID AS BUSINESS_UNIT_ID,
ind.ID as IndustryID, OS.NAME AS ORG_STRUCTURE_NAME,
org.RegionID as RegionID, IND.ID AS INDUSTRY_ID,
reg.Name as RegionName, ORG.REGION_ID AS REGION_ID,
os.ID as OrgStructureID, REG.NAME AS REGION_NAME,
area.ID as AreaID, OS.ID AS ORG_STRUCTURE_ID,
area.Name as AreaName, AREA.ID AS AREA_ID,
org.ClientCode as ClientCode, AREA.NAME AS AREA_NAME,
org.Code as Code, ORG.CLIENT_CODE AS CLIENT_CODE,
org.ParentID as ParentID, ORG.CODE AS CODE,
org.PLevel as PLevel, ORG.PARENT_ID AS PARENT_ID,
org.TaxPayerNumber as TaxPayerNumber ORG.P_LEVEL AS P_LEVEL,
from BusinessUnit as bu ORG.TAX_PAYER_NUMBER AS TAX_PAYER_NUMBER
left join Organization as org on bu.ID = org.BusinessUnitID and org.IsActive = 1 FROM
left join Industry as ind on org.IndustryID = ind.ID BUSINESS_UNIT AS BU
left join Area as area on org.AreaID = area.ID LEFT JOIN
left join OrganizationStructure as os on org.StructureID = os.ID ORGANIZATION AS ORG
left join Region as reg on org.RegionID = reg.ID ON
where bu.IsActive = 1 BU.ID = ORG.BUSINESS_UNIT_ID
AND ORG.IS_ACTIVE = 1
LEFT JOIN
INDUSTRY AS IND
ON
ORG.INDUSTRY_ID = IND.ID
LEFT JOIN
AREA AS AREA
ON
ORG.AREA_ID = AREA.ID
LEFT JOIN
ORGANIZATION_STRUCTURE AS OS
ON
ORG.STRUCTURE_ID = OS.ID
LEFT JOIN
REGION AS REG
ON
ORG.REGION_ID = REG.ID
WHERE
BU.IS_ACTIVE = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,48 +2,54 @@ ...@@ -2,48 +2,54 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CellTemplateConfigMapper"> <mapper namespace="pwc.taxtech.atms.dao.CellTemplateConfigMapper">
<select id="getCellTemplateConfigByTemplateId" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="getCellTemplateConfigByTemplateId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select b.* from cell_template a join cell_template_config b on a.id = b.cell_template_id where SELECT
a.report_template_id=#{templateID,jdbcType=VARCHAR} B.*
FROM
CELL_TEMPLATE A
JOIN
CELL_TEMPLATE_CONFIG B ON A.ID = B.CELL_TEMPLATE_ID
WHERE
A.REPORT_TEMPLATE_ID = #{TEMPLATEID,JDBCTYPE=VARCHAR}
</select> </select>
<delete id="deleteCellTemplateConfigByCellTemplate" parameterType="java.lang.Long"> <delete id="deleteCellTemplateConfigByCellTemplate" parameterType="java.lang.Long">
delete a.* DELETE A . * FROM CELL_TEMPLATE_CONFIG A
FROM
cell_template_config a
WHERE WHERE
id IN (select id from( ID IN (SELECT
SELECT ID
b.id
FROM FROM
cell_template_config b (SELECT
INNER JOIN cell_template c ON b.cell_template_id = c.id B.ID
WHERE FROM
c.report_template_id = #{templateDbID,jdbcType=VARCHAR} CELL_TEMPLATE_CONFIG B
) x) INNER JOIN CELL_TEMPLATE C ON B.CELL_TEMPLATE_ID = C.ID
WHER
C.REPORT_TEMPLATE_ID = #{TEMPLATEDBID,JDBCTYPE=VARCHAR}) X)
</delete> </delete>
<insert id="batchInsert" parameterType="pwc.taxtech.atms.entity.CellTemplateConfig"> <insert id="batchInsert" parameterType="pwc.taxtech.atms.entity.CellTemplateConfig">
INSERT INTO tax_admin.cell_template_config INSERT INTO TAX_ADMIN.CELL_TEMPLATE_CONFIG
(id, (ID,
cell_template_id, CELL_TEMPLATE_ID,
report_template_id, REPORT_TEMPLATE_ID,
data_source_type, DATA_SOURCE_TYPE,
formula, FORMULA,
formula_description, FORMULA_DESCRIPTION,
account_codes, ACCOUNT_CODES,
invoice_type, INVOICE_TYPE,
tax_rate, TAX_RATE,
invoice_amount_type, INVOICE_AMOUNT_TYPE,
model_ids, MODEL_IDS,
create_by, CREATE_BY,
create_time, CREATE_TIME,
update_by, UPDATE_BY,
update_time, UPDATE_TIME,
invoice_category, INVOICE_CATEGORY,
formula_data_source, FORMULA_DATA_SOURCE,
validation, VALIDATION,
validation_description, VALIDATION_DESCRIPTION,
voucher_keyword VOUCHER_KEYWORD
) )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -210,27 +216,27 @@ ...@@ -210,27 +216,27 @@
</insert> </insert>
<insert id="batchInsert2" parameterType="pwc.taxtech.atms.entity.CellTemplateConfig"> <insert id="batchInsert2" parameterType="pwc.taxtech.atms.entity.CellTemplateConfig">
INSERT INTO tax_admin.cell_template_config INSERT INTO TAX_ADMIN.CELL_TEMPLATE_CONFIG
(id, (ID,
cell_template_id, CELL_TEMPLATE_ID,
report_template_id, REPORT_TEMPLATE_ID,
data_source_type, DATA_SOURCE_TYPE,
formula, FORMULA,
formula_description, FORMULA_DESCRIPTION,
account_codes, ACCOUNT_CODES,
invoice_type, INVOICE_TYPE,
tax_rate, TAX_RATE,
invoice_amount_type, INVOICE_AMOUNT_TYPE,
model_ids, MODEL_IDS,
create_by, CREATE_BY,
create_time, CREATE_TIME,
update_by, UPDATE_BY,
update_time, UPDATE_TIME,
invoice_category, INVOICE_CATEGORY,
formula_data_source, FORMULA_DATA_SOURCE,
validation, VALIDATION,
validation_description, VALIDATION_DESCRIPTION,
voucher_keyword VOUCHER_KEYWORD
) )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CellTemplateMapper"> <mapper namespace="pwc.taxtech.atms.dao.CellTemplateMapper">
<insert id="batchInsert">
insert into CellTemplate (ID, ReportTemplateID, RowIndex,
RowName, ColumnIndex, ColumnName,
Comment, CreateTime, UpdateTime,
CopyFromID, DataType, IsReadOnly
)
values
<foreach collection="list" item="item" separator=",">
(#{item.ID,jdbcType=VARCHAR}, #{item.reportTemplateID,jdbcType=VARCHAR}, #{item.rowIndex,jdbcType=INTEGER},
#{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR},
#{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP},
#{item.copyFromID,jdbcType=VARCHAR}, #{item.dataType,jdbcType=INTEGER}, #{item.isReadOnly,jdbcType=INTEGER}
)
</foreach>
</insert>
<insert id="batchInsert2"> <insert id="batchInsert2">
insert into cell_template (id, report_template_id, row_index, INSERT INTO
row_name, column_index, column_name, CELL_TEMPLATE (
comment, create_time, update_time, ID,
copy_from_id, data_type, is_read_only, create_by, update_by REPORT_TEMPLATE_ID,
ROW_INDEX,
ROW_NAME,
COLUMN_INDEX,
COLUMN_NAME,
COMMENT,
CREATE_TIME,
UPDATE_TIME,
COPY_FROM_ID,
DATA_TYPE,
IS_READ_ONLY,
CREATE_BY,
UPDATE_BY
) )
values VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=INTEGER}, #{item.reportTemplateId,jdbcType=INTEGER}, #{item.rowIndex,jdbcType=INTEGER}, (
#{item.rowName,jdbcType=VARCHAR}, #{item.columnIndex,jdbcType=INTEGER}, #{item.columnName,jdbcType=VARCHAR}, #{item.id,jdbcType=INTEGER},
#{item.comment,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.reportTemplateId,jdbcType=INTEGER},
#{item.rowIndex,jdbcType=INTEGER},
#{item.rowName,jdbcType=VARCHAR},
#{item.columnIndex,jdbcType=INTEGER},
#{item.columnName,jdbcType=VARCHAR},
#{item.comment,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.copyFromId,jdbcType=INTEGER}, #{item.dataType,jdbcType=INTEGER}, #{item.copyFromId,jdbcType=INTEGER},
#{item.dataType,jdbcType=INTEGER},
#{item.isReadOnly,jdbcType=SMALLINT}, #{item.isReadOnly,jdbcType=SMALLINT},
#{item.createBy,jdbcType=VARCHAR}, #{item.updateBy,jdbcType=VARCHAR} #{item.createBy,jdbcType=VARCHAR},
#{item.updateBy,jdbcType=VARCHAR}
) )
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.DimensionMapper"> <mapper namespace="pwc.taxtech.atms.dao.DimensionMapper">
<resultMap id="OrganizationDto" type="pwc.taxtech.atms.dpo.OrganizationDto"> <resultMap id="OrganizationDto" type="pwc.taxtech.atms.dpo.OrganizationDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="DimensionID" jdbcType="VARCHAR" property="dimensionId"/> <result column="DIMENSION_ID" jdbcType="VARCHAR" property="dimensionId"/>
<result column="DimensionName" jdbcType="VARCHAR" property="dimensionName"/> <result column="DIMENSION_NAME" jdbcType="VARCHAR" property="dimensionName"/>
<result column="DimensionValueID" jdbcType="VARCHAR" property="dimensionValueID"/> <result column="DIMENSION_VALUE_ID" jdbcType="VARCHAR" property="dimensionValueId"/>
<result column="DimensionValueName" jdbcType="VARCHAR" property="dimensionValueName"/> <result column="DIMENSION_VALUE_NAME" jdbcType="VARCHAR" property="dimensionValueName"/>
<!-- 注意! OrganizationName 对应 name--> <!-- 注意! OrganizationName 对应 name-->
<result column="OrganizationName" jdbcType="VARCHAR" property="name"/> <result column="ORGANIZATION_NAME" jdbcType="VARCHAR" property="name"/>
<result column="AttributeID" jdbcType="VARCHAR" property="attributeId"/> <result column="ATTRIBUTE_ID" jdbcType="VARCHAR" property="attributeId"/>
<result column="BusinessUnitID" jdbcType="VARCHAR" property="businessUnitID"/> <result column="BUSINESS_UNIT_ID" jdbcType="VARCHAR" property="businessUnitId"/>
<result column="IndustryID" jdbcType="VARCHAR" property="industryID"/> <result column="INDUSTRY_ID" jdbcType="VARCHAR" property="industryId"/>
<result column="IndustryName" jdbcType="VARCHAR" property="industryName"/> <result column="INDUSTRY_NAME" jdbcType="VARCHAR" property="industryName"/>
<result column="RegionID" jdbcType="VARCHAR" property="regionID"/> <result column="REGION_ID" jdbcType="VARCHAR" property="regionId"/>
<result column="RegionName" jdbcType="VARCHAR" property="regionName"/> <result column="REGION_NAME" jdbcType="VARCHAR" property="regionName"/>
<result column="StructureID" jdbcType="VARCHAR" property="structureID"/> <result column="STRUCTURE_ID" jdbcType="VARCHAR" property="structureId"/>
<result column="AreaID" jdbcType="VARCHAR" property="areaID"/> <result column="AREA_ID" jdbcType="VARCHAR" property="areaId"/>
<result column="AreaName" jdbcType="VARCHAR" property="areaName"/> <result column="AREA_NAME" jdbcType="VARCHAR" property="areaName"/>
<result column="BusinessUnitName" jdbcType="VARCHAR" property="businessUnitName"/> <result column="BUSINESS_UNIT_NAME" jdbcType="VARCHAR" property="businessUnitName"/>
<result column="ClientCode" jdbcType="VARCHAR" property="clientCode"/> <result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode"/>
<result column="Code" jdbcType="VARCHAR" property="code"/> <result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="ParentID" jdbcType="VARCHAR" property="parentId"/> <result column="PARENT_ID" jdbcType="VARCHAR" property="parentId"/>
<result column="PLevel" jdbcType="INTEGER" property="pLevel"/> <result column="P_LEVEL" jdbcType="INTEGER" property="pLevel"/>
</resultMap> </resultMap>
<select id="getBusinessUnitListJoinDimensionResult" parameterType="map" resultMap="OrganizationDto">
select Distinct
org.ID as ID,
d.ID as DimensionID,
d.Name as DimensionName,
dv.ID as DimensionValueID,
dv.Name as DimensionValueName,
org.Name as OrganizationName, <select id="getBusinessUnitListJoinDimensionResult" parameterType="map" resultMap="OrganizationDto">
d.AttributeID as AttributeID, SELECT DISTINCT
bu.ID as BusinessUnitID, ORG.ID AS ID,
ind.ID as IndustryID, D.ID AS DIMENSION_ID,
ind.Name as IndustryName, D.NAME AS DIMENSION_NAME,
org.RegionID as RegionID, DV.ID AS DIMENSION_VALUE_ID,
reg.Name as RegionName, DV.NAME AS DIMENSION_VALUE_NAME,
os.ID as StructureID, ORG.NAME AS ORGANIZATION_NAME,
area.ID as AreaID, D.ATTRIBUTE_ID AS ATTRIBUTE_ID,
area.Name as AreaName, BU.ID AS BUSINESS_UNIT_ID,
bu.Name as BusinessUnitName, IND.ID AS INDUSTRY_ID,
org.ClientCode as ClientCode, IND.NAME AS INDUSTRY_NAME,
org.Code as Code, ORG.REGION_ID AS REGION_ID,
org.ParentID as ParentID, REG.NAME AS REGION_NAME,
org.PLevel as PLevel OS.ID AS STRUCTURE_ID,
AREA.ID AS AREA_ID,
from Dimension as d AREA.NAME AS AREA_NAME,
join DimensionValue as dv on d.ID = dv.DimensionID and dv.IsActive = 1 BU.NAME AS BUSINESS_UNIT_NAME,
left join DimensionValueOrg as dvg on dv.ID = dvg.DimensionValueID ORG.CLIENT_CODE AS CLIENT_CODE,
left join Organization as org on org.ID = dvg.OrganizationID ORG.CODE AS CODE,
ORG.PARENT_ID AS PARENT_ID,
ORG.P_LEVEL AS P_LEVEL
FROM
DIMENSION AS D
JOIN
DIMENSION_VALUE AS DV
ON
D.ID = DV.DIMENSION_ID
AND DV.IS_ACTIVE = 1
LEFT JOIN
DIMENSION_VALUE_ORG AS DVG
ON
DV.ID = DVG.DIMENSION_VALUE_ID
LEFT JOIN
ORGANIZATION AS ORG
ON
ORG.ID = DVG.ORGANIZATION_ID
<if test="orgIsActive != null and orgIsActive == true"> <if test="orgIsActive != null and orgIsActive == true">
and org.IsActive = 1 AND ORG.IS_ACTIVE = 1
</if> </if>
left join Industry as ind on org.IndustryID = ind.ID LEFT JOIN
left join BusinessUnit as bu on bu.ID = org.BusinessUnitID INDUSTRY AS IND
left join Area as area on org.AreaID = area.ID ON
left join OrganizationStructure as os on org.StructureID = os.ID ORG.INDUSTRY_ID = IND.ID
left join Region as reg on org.RegionID = reg.ID LEFT JOIN
where d.IsActive = 1 AND d.ID = #{dimensionId} BUSINESS_UNIT AS BU
ON
BU.ID = ORG.BUSINESS_UNIT_ID
LEFT JOIN
AREA AS AREA
ON
ORG.AREA_ID = AREA.ID
LEFT JOIN
ORGANIZATION_STRUCTURE AS OS
ON
ORG.STRUCTURE_ID = OS.ID
LEFT JOIN
REGION AS REG
ON
ORG.REGION_ID = REG.ID
WHERE
D.IS_ACTIVE = 1
AND D.ID = #{dimensionId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.DimensionValueMapper"> <mapper namespace="pwc.taxtech.atms.dao.DimensionValueMapper">
<select id="selectByIDIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByIDIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- select one record by ID ignore case --> <!-- select one record by ID ignore case -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from DimensionValue FROM
where lower(ID) = lower(#{dimensionValueId}) DIMENSION_VALUE
WHERE
LOWER(ID) = LOWER( #{dimensionValueId})
</select> </select>
<resultMap id="DimensionValueJoinDimensionDto" type="pwc.taxtech.atms.dto.dimension.DimensionValueJoinDimensionDto"> <resultMap id="DimensionValueJoinDimensionDto" type="pwc.taxtech.atms.dto.dimension.DimensionValueJoinDimensionDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="DimensionName" jdbcType="VARCHAR" property="dimensionName"/> <result column="DIMENSION_NAME" jdbcType="VARCHAR" property="dimensionName"/>
<result column="DimensionValue" jdbcType="VARCHAR" property="dimensionValue"/> <result column="DIMENSION_VALUE" jdbcType="VARCHAR" property="dimensionValue"/>
<result column="DimensionValueID" jdbcType="VARCHAR" property="dimensionValueID"/> <result column="DIMENSION_VALUE_ID" jdbcType="VARCHAR" property="dimensionValueId"/>
</resultMap> </resultMap>
<select id="selectDimensionValueJoinDimension" resultMap="DimensionValueJoinDimensionDto"> <select id="selectDimensionValueJoinDimension" resultMap="DimensionValueJoinDimensionDto">
select q.Name as DimensionName, SELECT
p.Name as DimensionValue, Q.NAME AS DIMENSION_NAME,
p.ID as DimensionValueID P.NAME AS DIMENSION_VALUE,
from DimensionValue as p P.ID AS DIMENSION_VALUE_ID
join Dimension as q FROM
on p.DimensionID = q.ID DIMENSION_VALUE AS P
JOIN
DIMENSION AS Q
ON
P.DIMENSION_ID = Q.ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.DimensionValueOrgMapper"> <mapper namespace="pwc.taxtech.atms.dao.DimensionValueOrgMapper">
<resultMap id="UnionDimensionValueOrg" type="pwc.taxtech.atms.dto.dimension.UnionDimensionValueOrg"> <resultMap id="UnionDimensionValueOrg" type="pwc.taxtech.atms.dto.dimension.UnionDimensionValueOrg">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="DimensionValueID" jdbcType="VARCHAR" property="dimensionValueID"/> <result column="DIMENSION_VALUE_ID" jdbcType="VARCHAR" property="dimensionValueId"/>
<result column="OrganizationID" jdbcType="VARCHAR" property="organizationID"/> <result column="ORGANIZATION_ID" jdbcType="VARCHAR" property="organizationId"/>
<result column="DimensionID" jdbcType="VARCHAR" property="dimensionId"/> <result column="DIMENSION_ID" jdbcType="VARCHAR" property="dimensionId"/>
<result column="DimensionValueName" jdbcType="VARCHAR" property="dimensionValueName"/> <result column="DIMENSION_VALUE_NAME" jdbcType="VARCHAR" property="dimensionValueName"/>
</resultMap> </resultMap>
<select id="selectUnionDimensionValueOrgByDimension" parameterType="pwc.taxtech.atms.dto.DimensionParamDto" <select id="selectUnionDimensionValueOrgByDimension" parameterType="pwc.taxtech.atms.dto.DimensionParamDto" resultMap="UnionDimensionValueOrg">
resultMap="UnionDimensionValueOrg"> SELECT
select * from *
(select #{organizationStructureID} as ID, StructureID as DimensionValueID, ID as FROM
OrganizationID from Organization (
union SELECT
select #{businessUnitID} as ID, BusinessUnitID as DimensionValueID, ID as #{organizationStructureID} AS ID,
OrganizationID from Organization STRUCTURE_ID AS DIMENSION_VALUE_ID,
union ID AS ORGANIZATION_ID
select #{areaID} as ID, AreaID as DimensionValueID, ID as OrganizationID FROM
from Organization ORGANIZATION
union UNION
select ID, DimensionValueID, OrganizationID from DimensionValueOrg) as q SELECT
join #{businessUnitID} AS ID,
(select ID as DimensionValueID, Name as DimensionValueName, BUSINESS_UNIT_ID AS DIMENSION_VALUE_ID,
IsActive, #{organizationStructureID} as DimensionID, CreateTime, UpdateTime from ID AS ORGANIZATION_ID
OrganizationStructure where IsActive=1 FROM
union ORGANIZATION
select ID as DimensionValueID, Name as DimensionValueName,
IsActive, #{businessUnitID} as DimensionID, CreateTime, UpdateTime from UNION
BusinessUnit where IsActive=1
union SELECT
select ID as DimensionValueID, Name as DimensionValueName, #{areaID} AS ID,
IsActive, #{areaID} as DimensionID, now() as CreateTime, AREA_ID AS DIMENSION_VALUE_ID,
now() as UpdateTime from Area where IsActive=1 ID AS ORGANIZATION_ID
FROM
ORGANIZATION
UNION
SELECT
ID,
DimensionValueID,
OrganizationID
FROM
DIMENSION_VALUE_ORG
)
AS Q
JOIN
(
SELECT
ID AS DIMENSION_VALUE_ID,
Name AS DIMENSION_VALUE_NAME,
IS_ACTIVE,
#{organizationStructureID} AS DIMENSION_ID,
CREATE_TIME,
UPDATE_TIME
FROM
ORGANIZATION_STRUCTURE
WHERE
IS_ACTIVE=1
union union
select ID as DimensionValueID, Name as DimensionValueName,
IsActive, DimensionID, CreateTime, UpdateTime from DimensionValue SELECT
where IsActive=1) as p ID AS DIMENSION_VALUE_ID,
on p.DimensionValueID = q.DimensionValueID NAME AS DIMENSION_VALUE_NAME,
join IS_ACTIVE,
Dimension as r on r.IsActive = 1 and p.DimensionID = r.ID #{businessUnitID} AS DIMENSION_ID,
CREATE_TIME,
UPDATE_TIME
FROM
BUSINESS_UNIT
WHERE
IS_ACTIVE=1
UNION
SELECT
ID AS DIMENSION_VALUE_ID,
NAME AS DIMENSION_VALUE_NAME,
IS_ACTIVE,
#{areaID} AS DIMENSION_ID,
now (
)
AS CREATE_TIME,
now (
)
AS UPDATE_TIME
FROM
AREA
WHERE
IS_ACTIVE=1
UNION
SELECT
ID AS DIMENSION_VALUE_ID,
NAME AS DIMENSION_VALUE_NAME,
IS_ACTIVE,
DIMENSION_ID,
CREATE_TIME,
UPDATE_TIME
FROM
DIMENSION_VALUE
WHERE
IS_ACTIVE=1
)
AS P
on
p.DIMENSION_VALUE_ID = q.DIMENSION_VALUE_ID
JOIN
DIMENSION AS R
on
r.IS_ACTIVE = 1
AND P.DIMENSION_ID = r.ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,35 +3,62 @@ ...@@ -3,35 +3,62 @@
<mapper namespace="pwc.taxtech.atms.dao.EnterpriseAccountMapper"> <mapper namespace="pwc.taxtech.atms.dao.EnterpriseAccountMapper">
<select id="getDto" resultType="pwc.taxtech.atms.dpo.EnterpriseAccountDto"> <select id="getDto" resultType="pwc.taxtech.atms.dpo.EnterpriseAccountDto">
SELECT ea.ID, ea.CODE as code, ea.NAME as name, ea.ParentCode as parentCode, ea.FullName as fullName SELECT
, ea.IsLeaf as isLeaf, ea.RuleType as ruleType, ea.AcctLevel as acctLevel, ea.AcctProp as acctProp, ea.Direction EA.ID,
as direction ea.CODE AS CODE,
, ea.IsActive as isActive ea.NAME AS NAME,
, CASE ea.PARENT_CODE AS PARENT_CODE,
WHEN am.StandardAccountCode = '0000' THEN am.StandardAccountCode ea.FULL_NAME AS FULL_NAME,
ELSE sa.CODE ea.IS_LEAF AS IS_LEAF,
END AS stdCode, sa.NAME AS stdName, sa.ParentCode AS stdParentCode, sa.Direction AS stdDirection, sa.AcctProp AS ea.RULE_TYPE AS RULE_TYPE,
stdAcctProp ea.ACCT_LEVEL AS ACCT_LEVEL,
, sa.FullName AS stdFullName ea.ACCT_PROP AS ACCT_PROP,
FROM ( ea.DIRECTION AS DIRECTION,
SELECT * ea.IS_ACTIVE AS IS_ACTIVE,
FROM EnterpriseAccount CASE WHEN am.STANDARD_ACCOUNT_CODE = '0000' THEN am.STANDARD_ACCOUNT_CODE ELSE sa.CODE END AS STD_CODE,
WHERE Enterpriseaccountsetid = #{epAccountSetID} sa.NAME AS STD_NAME,
) ea sa.PARENT_CODE AS STD_PARENT_CODE,
LEFT JOIN ( sa.DIRECTION AS STD_DIRECTION,
SELECT * sa.ACCT_PROP AS STD_ACCT_PROP,
FROM AccountMapping sa.FULL_NAME AS STD_FULL_NAME
WHERE OrganizationID = #{orgId} FROM
AND IndustryID = #{industryId} (
AND EnterpriseAccountSetID = #{epAccountSetID} SELECT
) am *
ON ea.CODE = am.EnterpriseAccountCode FROM
LEFT JOIN ( ENTERPRISE_ACCOUNT
SELECT * WHERE
FROM StandardAccount ENTERPRISE_ACCOUNTSET_ID = #{epAccountSetID}
WHERE IndustryID = #{industryId} )
) sa ea
ON am.StandardAccountCode = sa.CODE LEFT JOIN
ORDER BY ea.CODE (
SELECT
*
FROM
ACCOUNT_MAPPING
WHERE
ORGANIZATION_ID = #{orgId}
AND INDUSTRY_ID = #{industryId}
AND ENTERPRISE_ACCOUNT_SET_ID = #{epAccountSetID}
)
am
ON
ea.CODE = am.ENTERPRISE_ACCOUNT_CODE
LEFT JOIN
(
SELECT
*
FROM
STANDARD_ACCOUNT
WHERE
IndustryID = #{industryId}
)
sa
ON
am.STANDARD_ACCOUNT_CODE = sa.CODE
ORDER BY
ea.CODE
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.EnterpriseAccountSetMapper"> <mapper namespace="pwc.taxtech.atms.dao.EnterpriseAccountSetMapper">
<select id="getAccountDtoByOrgId" resultMap="BaseResultMap"> <select id="getAccountDtoByOrgId" resultMap="BaseResultMap">
select ta.ID, ta.Code, ta.Name, ta.IsActive, ta.CreatorID, ta.CreateTime, ta.UpdateTime SELECT
from EnterpriseAccountSet ta TA.ID,
left outer join EnterpriseAccountSetOrg tb ta.CODE,
on ta.ID = tb.EnterpriseAccountSetID ta.NAME,
where tb.OrganizationID=#{orgId} ta.IS_ACTIVE,
ta.CREATOR_ID,
ta.CREATE_TIME,
ta.UPDATE_TIME
FROM
ENTERPRISE_ACCOUNT_SET ta
left outer JOIN
ENTERPRISE_ACCOUNT_SET_ORG tb
on
ta.ID = tb.ENTERPRISE_ACCOUNT_SET_ID
where
tb.ORGANIZATION_ID_= #{orgId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -8,37 +8,43 @@ ...@@ -8,37 +8,43 @@
</resultMap> </resultMap>
<select id="selectByExampleWithAssociation" parameterType="pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample" <select id="selectByExampleWithAssociation" parameterType="pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample"
resultMap="ResultMapWithAssociation"> resultMap="ResultMapWithAssociation">
select SELECT
<if test="distinct"> <if test="distinct">
distinct DISTINCT
</if> </if>
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from EnterpriseAccountSetOrg FROM ENTERPRISE_ACCOUNT_SET_ORG
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause"/> <include refid="Example_Where_Clause"/>
</if> </if>
<if test="orderByClause != null"> <if test="orderByClause != null">
order by ${orderByClause} ORDER BY ${orderByClause}
</if> </if>
</select> </select>
<resultMap id="EnterpriseAccountSetOrgDto" type="pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto"> <resultMap id="EnterpriseAccountSetOrgDto" type="pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="EnterpriseAccountSetID" jdbcType="VARCHAR" property="enterpriseAccountSetID"/> <result column="ENTERPRISE_ACCOUNT_SET_ID" jdbcType="VARCHAR" property="enterpriseAccountSetId"/>
<result column="OrganizationID" jdbcType="VARCHAR" property="organizationID"/> <result column="ORGANIZATION_ID" jdbcType="VARCHAR" property="organizationId"/>
<result column="EffectiveDate" jdbcType="VARCHAR" property="effectiveDate"/> <result column="EFFECTIVE_DATE" jdbcType="VARCHAR" property="effectiveDate"/>
<result column="ExpiredDate" jdbcType="VARCHAR" property="expiredDate"/> <result column="EXPIRED_DATE" jdbcType="VARCHAR" property="expiredDate"/>
<result column="EnterpriseAccountSetName" jdbcType="VARCHAR" property="enterpriseAccountSetName"/> <result column="ENTERPRISE_ACCOUNT_SET_NAME" jdbcType="VARCHAR" property="enterpriseAccountSetName"/>
</resultMap> </resultMap>
<select id="getSingleOrgByOrgIDToEASODto" parameterType="map" resultMap="EnterpriseAccountSetOrgDto"> <select id="getSingleOrgByOrgIDToEASODto" parameterType="map" resultMap="EnterpriseAccountSetOrgDto">
select SELECT
m.ID as ID, M.ID AS ID,
m.EnterpriseAccountSetID as EnterpriseAccountSetID, m.ENTERPRISE_ACCOUNT_SET_ID AS ENTERPRISE_ACCOUNT_SET_ID,
m.OrganizationID as OrganizationID, m.ORGANIZATION_ID AS ORGANIZATION_ID,
m.EffectiveDate as EffectiveDate, m.EFFECTIVE_DATE AS EFFECTIVE_DATE,
m.ExpiredDate as ExpiredDate, m.EXPIRED_DATE AS EXPIRED_DATE,
n.Name as EnterpriseAccountSetName n.NAME AS ENTERPRISE_ACCOUNT_SET_NAME
from EnterpriseAccountSetOrg as m FROM
left join EnterpriseAccountSet as n on m.EnterpriseAccountSetID = n.ID ENTERPRISE_ACCOUNT_SET_ORG AS M
where m.OrganizationID = #{orgId} left JOIN
ENTERPRISE_ACCOUNT_SET AS N
on
m.ENTERPRISE_ACCOUNT_SET_ID = n.ID
WHERE
m.ORGANIZATION_ID = #{orgId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.IndustryMapper"> <mapper namespace="pwc.taxtech.atms.dao.IndustryMapper">
<select id="getAllAvailableIndustry" resultMap="BaseResultMap"> <select id="getAllAvailableIndustry" resultMap="BaseResultMap">
SELECT SELECT
* *
FROM FROM
Industry INDUSTRY
WHERE WHERE
isActive = 1 isActive = 1
AND Name IN ('通用行业' ,'房地产业', '资产管理', '银行及其他金融服务业') AND NAME IN (
'通用行业',
'房地产业',
'资产管理',
'银行及其他金融服务业'
)
</select> </select>
<resultMap id="TemplateGroup" type="pwc.taxtech.atms.entity.TemplateGroup"> <resultMap id="TemplateGroup" type="pwc.taxtech.atms.entity.TemplateGroup">
<!--
WARNING - @mbg.generated <!-- WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. -->
This element is automatically generated by MyBatis Generator, do not modify. <id column="ID" jdbcType="BIGINT" property="id"/>
--> <result column="NAME" jdbcType="VARCHAR" property="name"/>
<id column="id" jdbcType="BIGINT" property="id"/> <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="INDUSTRY_IDS" jdbcType="VARCHAR" property="industryIds"/>
<result column="service_type_id" jdbcType="VARCHAR" property="serviceTypeId"/> <result column="PAY_TAX_TYPE" jdbcType="INTEGER" property="payTaxType"/>
<result column="industry_ids" jdbcType="VARCHAR" property="industryIds"/> <result column="GROUP_TYPE" jdbcType="INTEGER" property="groupType"/>
<result column="pay_tax_type" jdbcType="INTEGER" property="payTaxType"/> <result column="COPY_FROM" jdbcType="BIGINT" property="copyFrom"/>
<result column="group_type" jdbcType="INTEGER" property="groupType"/> <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="copy_from" jdbcType="BIGINT" property="copyFrom"/> <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="IS_SYSTEM_TYPE" jdbcType="INTEGER" property="isSystemType"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy"/>
<result column="is_system_type" jdbcType="INTEGER" property="isSystemType"/> <result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
</resultMap> </resultMap>
<select id="getTemplateGroup" resultMap="TemplateGroup"> <select id="getTemplateGroup" resultMap="TemplateGroup">
SELECT b.* SELECT
FROM Industry a B.*
JOIN template_group b FROM
ON a.ID = b.industry_ids INDUSTRY a
WHERE a.Name = '通用行业' JOIN
AND b.group_type = 2 template_group b
LIMIT 1 ON
a.ID = b.industry_ids
WHERE
a.NAME = '通用行业'
AND B.group_type = 2 LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.KeyValueConfigMapper"> <mapper namespace="pwc.taxtech.atms.dao.KEY_VALUE_CONFIGMapper">
<select id="selectKeyValueConfigsByOrderByCreateTime" resultMap="BaseResultMap">
SELECT KeyValueConfig.ID, <select id="selectKEY_VALUE_CONFIGsByOrderByCreateTime" resultMap="BaseResultMap">
KeyValueConfig.KeyCode, SELECT
KeyValueConfig.Name, KEY_VALUE_CONFIG.ID,
KeyValueConfig.KeyValueType, KEY_VALUE_CONFIG.KEY_CODE,
KeyValueConfig.Formula, KEY_VALUE_CONFIG.NAME,
KeyValueConfig.IsConstant, KEY_VALUE_CONFIG.KEY_VALUE_TYPE,
KeyValueConfig.CalculateStatus, KEY_VALUE_CONFIG.FORMULA,
KeyValueConfig.ResultType, KEY_VALUE_CONFIG.IS_CONSTANT,
KeyValueConfig.ServiceTypeIDs, KEY_VALUE_CONFIG.CALCULATE_STATUS,
KeyValueConfig.IndustryIDs, KEY_VALUE_CONFIG.RESULT_TYPE,
KeyValueConfig.Description, KEY_VALUE_CONFIG.SERVICE_TYPE_IDS,
KeyValueConfig.Creator, KEY_VALUE_CONFIG.INDUSTRY_IDS,
KeyValueConfig.CreateTime, KEY_VALUE_CONFIG.DESCRIPTION,
KeyValueConfig.Updator, KEY_VALUE_CONFIG.CREATOR,
KeyValueConfig.UpdateTime, KEY_VALUE_CONFIG.CREATE_TIME,
KeyValueConfig.DataSource KEY_VALUE_CONFIG.UPDATOR,
FROM tax_admin.KeyValueConfig order by KeyValueConfig.createtime KEY_VALUE_CONFIG.UPDATE_TIME,
KEY_VALUE_CONFIG.DATA_SOURCE
FROM
TAX_ADMIN.KEY_VALUE_CONFIG
ORDER BY
KEY_VALUE_CONFIG.CREATETIME
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,91 +3,132 @@ ...@@ -3,91 +3,132 @@
<mapper namespace="pwc.taxtech.atms.dao.KeyValueReferenceMapper"> <mapper namespace="pwc.taxtech.atms.dao.KeyValueReferenceMapper">
<delete id="deleteKeyValueReferenceByCellTemplate" parameterType="java.lang.Long"> <delete id="deleteKeyValueReferenceByCellTemplate" parameterType="java.lang.Long">
delete a.* delete
FROM a.* FROM
KeyValueReference a KEY_VALUE_REFERENCE a
WHERE WHERE
ID IN (select ID from( ID IN (
SELECT
ID
FROM
(
SELECT SELECT
b.ID B.ID
FROM FROM
KeyValueReference b KEY_VALUE_REFERENCE b
INNER JOIN cell_template c ON b.CellTemplateID = c.ID INNER JOIN
CELL_TEMPLATE c
ON
b.CELL_TEMPLATE_ID = c.ID
WHERE WHERE
c.report_template_id = #{templateDbID,jdbcType=VARCHAR} c.REPORT_TEMPLATE_ID = #{templateDbID,jdbcType=VARCHAR}
) x) )
x
)
</delete> </delete>
<resultMap id="financialStatementDetail" type="pwc.taxtech.atms.dpo.FinancialStatementDetail"> <resultMap id="financialStatementDetail" type="pwc.taxtech.atms.dpo.FinancialStatementDetail">
<id column="Name" jdbcType="VARCHAR" property="name"/> <id column="Name" jdbcType="VARCHAR" property="name"/>
<result column="Industry" jdbcType="VARCHAR" property="industry"/> <result column="INDUSTRY" jdbcType="VARCHAR" property="industry"/>
<result column="Row" jdbcType="INTEGER" property="row"/> <result column="ROW" jdbcType="INTEGER" property="row"/>
<result column="Column" jdbcType="INTEGER" property="column"/> <result column="COLUMN" jdbcType="INTEGER" property="column"/>
</resultMap> </resultMap>
<select id="getFinancialStatementDetails" parameterType="java.lang.String" resultMap="financialStatementDetail"> <select id="getFinancialStatementDetails" parameterType="java.lang.String" resultMap="financialStatementDetail">
SELECT DISTINCT SELECT DISTINCT
t.Name, t.NAME,
c.RowIndex, c.ROW_INDEX,
c.ColumnIndex, c.COLUMN_INDEX,
g.IndustryIDs g.INDUSTRY_IDS
FROM FROM
KeyValueReference s KEY_VALUE_REFERENCE s
JOIN CellTemplate c ON s.CellTemplateID = c.ID JOIN
JOIN Template t ON c.ReportTemplateID = t.ID CELL_TEMPLATE c
JOIN TemplateGroup g ON t.TemplateGroupID = g.ID ON
s.CELL_TEMPLATE_ID = c.ID
JOIN
TEMPLATE t
ON
c.REPORT_TEMPLATE_ID = t.ID
JOIN
TEMPLATE_GROUP g
ON
t.TEMPLATE_GROUP_ID = g.ID
WHERE WHERE
s.Scope = 1 AND s.KeyValueConfigID = #{configurationID,jdbcType=VARCHAR} s.SCOPE = 1
AND S.KEY_VALUE_CONFIG_ID = #{configurationID,jdbcType=VARCHAR}
</select> </select>
<resultMap id="taxReturnDetail" type="pwc.taxtech.atms.dpo.TaxReturnDetail"> <resultMap id="taxReturnDetail" type="pwc.taxtech.atms.dpo.TaxReturnDetail">
<id column="CellTemplateID" jdbcType="VARCHAR" property="cellTemplateID"/> <id column="CellTemplateID" jdbcType="VARCHAR" property="cellTemplateID"/>
<result column="TemplateID" jdbcType="VARCHAR" property="templateID"/> <result column="TEMPLATE_ID" jdbcType="VARCHAR" property="templateId"/>
<result column="TemplateGroupID" jdbcType="VARCHAR" property="templateGroupID"/> <result column="TEMPLATE_GROUP_ID" jdbcType="VARCHAR" property="templateGroupId"/>
<result column="Category" jdbcType="VARCHAR" property="category"/> <result column="CATEGORY" jdbcType="VARCHAR" property="category"/>
<result column="PayTaxType" jdbcType="INTEGER" property="payTaxType"/> <result column="PAY_TAX_TYPE" jdbcType="INTEGER" property="payTaxType"/>
<result column="TemplateGroupName" jdbcType="VARCHAR" property="templateGroupName"/> <result column="TEMPLATE_GROUP_NAME" jdbcType="VARCHAR" property="templateGroupName"/>
<result column="Name" jdbcType="VARCHAR" property="name"/> <result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="Industry" jdbcType="VARCHAR" property="industry"/> <result column="INDUSTRY" jdbcType="VARCHAR" property="industry"/>
<result column="Row" jdbcType="INTEGER" property="row"/> <result column="ROW" jdbcType="INTEGER" property="row"/>
<result column="Column" jdbcType="INTEGER" property="column"/> <result column="COLUMN" jdbcType="INTEGER" property="column"/>
</resultMap> </resultMap>
<select id="getTaxReturnDetails" parameterType="java.lang.String" resultMap="taxReturnDetail"> <select id="getTaxReturnDetails" parameterType="java.lang.String" resultMap="taxReturnDetail">
SELECT DISTINCT SELECT DISTINCT
t.ID, t.ID,
'增值税纳税申报表' as Category, '增值税纳税申报表' AS CATEGORY,
g.PayTaxType, g.PAY_TAX_TYPE,
g.ID as TemplateGroupID, g.ID AS TEMPLATE_GROUP_ID,
g.Name as TemplateGroupName, g.NAME AS TEMPLATE_GROUP_NAME,
t.Name as Name, t.NAME AS NAME,
c.ID as CellTemplateID, c.ID AS CELL_TEMPLATE_ID,
c.RowIndex as Row, c.ROW_INDEX AS ROW,
c.ColumnIndex as 'Column', c.COLUMN_INDEX AS '_COLUMN_',
g.IndustryIDs as Industry g.INDUSTRY_IDS AS INDUSTRY
FROM FROM
KeyValueReference s KEY_VALUE_REFERENCE s
JOIN CellTemplate c ON s.CellTemplateID = c.ID JOIN
JOIN Template t ON c.ReportTemplateID = t.ID CELL_TEMPLATE c
JOIN TemplateGroup g ON t.TemplateGroupID = g.ID ON
s.CELL_TEMPLATE_ID = c.ID
JOIN
TEMPLATE t
ON
c.REPORT_TEMPLATE_ID = t.ID
JOIN
TEMPLATE_GROUP g
ON
t.TEMPLATE_GROUP_ID = g.ID
WHERE WHERE
s.Scope = 2 AND s.KeyValueConfigID = #{configurationID,jdbcType=VARCHAR} s.SCOPE = 2
AND S.KEY_VALUE_CONFIG_ID = #{configurationID,jdbcType=VARCHAR}
</select> </select>
<resultMap id="analyticsModelDetail" type="pwc.taxtech.atms.dpo.AnalyticsModelDetail"> <resultMap id="analyticsModelDetail" type="pwc.taxtech.atms.dpo.AnalyticsModelDetail">
<id column="ModelID" jdbcType="VARCHAR" property="modelID"/> <id column="ModelID" jdbcType="VARCHAR" property="modelID"/>
<result column="Code" jdbcType="VARCHAR" property="code"/> <result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="Type" jdbcType="VARCHAR" property="type"/> <result column="TYPE" jdbcType="VARCHAR" property="type"/>
<result column="EntityID" jdbcType="VARCHAR" property="entityID"/> <result column="ENTITY_ID" jdbcType="VARCHAR" property="entityId"/>
<result column="Name" jdbcType="VARCHAR" property="name"/> <result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="Industry" jdbcType="VARCHAR" property="industry"/> <result column="INDUSTRY" jdbcType="VARCHAR" property="industry"/>
</resultMap> </resultMap>
<select id="getAnalyticsModelDetails" parameterType="java.lang.String" resultMap="analyticsModelDetail"> <select id="getAnalyticsModelDetails" parameterType="java.lang.String" resultMap="analyticsModelDetail">
SELECT DISTINCT SELECT DISTINCT
m.ID as ModelID, m.ID AS MODEL_ID,
m.Code as Code, m.CODE AS CODE,
m.Type as Type, m.TYPE AS TYPE,
s.OrganizationID as EntityID, s.ORGANIZATION_ID AS ENTITY_ID,
m.Name as Name, m.NAME AS NAME,
s.IndustryID as Industry s.INDUSTRY_ID AS INDUSTRY
FROM tax_admin.KeyValueReference s FROM
JOIN tax_admin.Model m TAX_ADMIN.KEY_VALUE_REFERENCE s
ON s.ModelID = m.ID JOIN
WHERE s.Scope = 3 AND s.KeyValueConfigID = #{configurationID,jdbcType=VARCHAR} TAX_ADMIN.MODEL m
ON
s.MODEL_ID = m.ID
WHERE
s.SCOPE = 3
AND S.KEY_VALUE_CONFIG_ID = #{configurationID,jdbcType=VARCHAR}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.ModelConfigMapper"> <mapper namespace="pwc.taxtech.atms.dao.ModelConfigMapper">
<resultMap id="getModelListByIndustryResult" type="pwc.taxtech.atms.dpo.ModelProfileDto"> <resultMap id="getModelListByIndustryResult" type="pwc.taxtech.atms.dpo.ModelProfileDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="Name" jdbcType="VARCHAR" property="name"/> <result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="CategoryID" jdbcType="VARCHAR" property="categoryID"/> <result column="CATEGORY_ID" jdbcType="VARCHAR" property="categoryId"/>
<result column="CategoryString" jdbcType="VARCHAR" property="categoryString"/> <result column="CATEGORY_STRING" jdbcType="VARCHAR" property="categoryString"/>
<result column="OrgID" jdbcType="VARCHAR" property="orgID"/> <result column="ORG_ID" jdbcType="VARCHAR" property="orgId"/>
<result column="OrganizationName" jdbcType="VARCHAR" property="organizationName"/> <result column="ORGANIZATION_NAME" jdbcType="VARCHAR" property="organizationName"/>
<result column="Type" jdbcType="INTEGER" property="type"/> <result column="TYPE" jdbcType="INTEGER" property="type"/>
<result column="Feature" jdbcType="INTEGER" property="feature"/> <result column="FEATURE" jdbcType="INTEGER" property="feature"/>
<result column="IsStatus" jdbcType="INTEGER" property="isStatus"/> <result column="IS_STATUS" jdbcType="INTEGER" property="isStatus"/>
<result column="Code" jdbcType="VARCHAR" property="code"/> <result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="IndustryId" jdbcType="VARCHAR" property="industryID"/> <result column="INDUSTRY_ID" jdbcType="VARCHAR" property="industryId"/>
<result column="IndustryName" jdbcType="VARCHAR" property="industryName"/> <result column="INDUSTRY_NAME" jdbcType="VARCHAR" property="industryName"/>
<result column="Description" jdbcType="VARCHAR" property="description"/> <result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>
<result column="RuleType" jdbcType="INTEGER" property="ruleType"/> <result column="RULE_TYPE" jdbcType="INTEGER" property="ruleType"/>
<result column="IsFilter" jdbcType="INTEGER" property="isFilter"/> <result column="IS_FILTER" jdbcType="INTEGER" property="isFilter"/>
<result column="ServiceTypeID" jdbcType="VARCHAR" property="serviceTypeID"/> <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId"/>
<result column="ServiceTypeName" jdbcType="VARCHAR" property="serviceTypeName"/> <result column="SERVICE_TYPE_NAME" jdbcType="VARCHAR" property="serviceTypeName"/>
</resultMap> </resultMap>
<select id="getModelListByIndustry" parameterType="map" resultMap="getModelListByIndustryResult"> <select id="getModelListByIndustry" parameterType="map" resultMap="getModelListByIndustryResult">
SELECT SELECT
m.ID, M.ID,
m.Name, m.NAME,
mc.CategoryID, mc.CATEGORY_ID,
cat.Category AS CategoryString, cat.CATEGORY AS CATEGORY_STRING,
cat.OrganizationID AS OrgID, cat.ORGANIZATION_ID AS ORG_ID,
org.Name AS OrganizationName, org.NAME AS ORGANIZATION_NAME,
m.Type, m.TYPE,
m.Feature, m.FEATURE,
m.IsStatus, m.IS_STATUS,
m.Code, m.CODE,
org.IndustryID AS IndustryId, org.INDUSTRY_ID AS INDUSTRY_ID,
i.Name AS IndustryName, i.NAME AS INDUSTRY_NAME,
m.Description, m.DESCRIPTION,
m.RuleType, m.RULE_TYPE,
m.IsFilter, m.IS_FILTER,
msc.ServiceTypeID, msc.SERVICE_TYPE_ID,
st.Name AS ServiceTypeName st.NAME AS SERVICE_TYPE_NAME
FROM FROM
Model m MODEL m
JOIN JOIN
ModelConfig mc ON m.ID = mc.ModelID MODEL_CONFIG mc
ON
m.ID = mc.MODEL_ID
JOIN JOIN
ModelCategory cat ON mc.CategoryID = cat.ID MODEL_CATEGORY cat
ON
mc.CATEGORY_ID = cat.ID
JOIN JOIN
Organization org ON cat.organizationID = org.ID ORGANIZATION org
ON
cat.ORGANIZATION_ID = org.ID
JOIN JOIN
ModelServiceConfig msc ON m.ID = msc.ModelID MODEL_SERVICE_CONFIG msc
ON
m.ID = msc.MODEL_ID
JOIN JOIN
ServiceType st ON msc.ServiceTypeID = st.ID SERVICE_TYPE st
ON
msc.SERVICE_TYPE_ID = st.ID
JOIN JOIN
Industry i ON org.IndustryID = i.ID INDUSTRY i
WHERE org.IndustryID=#{industryID,jdbcType=VARCHAR} and st.ID = #{serviceTypeID,jdbcType=VARCHAR} ON
ORDER BY m.code org.INDUSTRY_ID = i.ID
WHERE
org.INDUSTRY_ID_= #{industryID,jdbcType=VARCHAR}
AND ST.ID = #{serviceTypeID,jdbcType=VARCHAR}
ORDER BY
m.CODE
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.OrganizationServiceTemplateGroupMapper"> <mapper namespace="pwc.taxtech.atms.dao.OrganizationServiceTemplateGroupMapper">
<resultMap id="OrganizationServiceTemplateGroupDto" type="pwc.taxtech.atms.dpo.OrganizationServiceTemplateGroupDto"> <resultMap id="OrganizationServiceTemplateGroupDto" type="pwc.taxtech.atms.dpo.OrganizationServiceTemplateGroupDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="ServiceTypeID" jdbcType="VARCHAR" property="serviceTypeID"/> <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId"/>
<result column="OrganizationID" jdbcType="VARCHAR" property="organizationID"/> <result column="ORGANIZATION_ID" jdbcType="VARCHAR" property="organizationId"/>
<result column="TemplateGroupID" jdbcType="VARCHAR" property="templateGroupID"/> <result column="TEMPLATE_GROUP_ID" jdbcType="VARCHAR" property="templateGroupId"/>
<result column="TemplateGroupName" jdbcType="VARCHAR" property="templateGroupName"/> <result column="TEMPLATE_GROUP_NAME" jdbcType="VARCHAR" property="templateGroupName"/>
</resultMap> </resultMap>
<select id="getSingleOrgByOrgIDToOSTGDto" parameterType="map" resultMap="OrganizationServiceTemplateGroupDto"> <select id="getSingleOrgByOrgIDToOSTGDto" parameterType="map" resultMap="OrganizationServiceTemplateGroupDto">
SELECT SELECT
m.ID AS ID, M.ID AS ID,
m.service_type_id AS ServiceTypeID, M.SERVICE_TYPE_ID AS SERVICE_TYPE_ID,
m.organization_id AS OrganizationID, M.ORGANIZATION_ID AS ORGANIZATION_ID,
m.template_group_id AS TemplateGroupID, M.TEMPLATE_GROUP_ID AS TEMPLATE_GROUP_ID,
t.Name AS TemplateGroupName T.NAME AS TEMPLATE_GROUP_NAME
FROM FROM
organization_service_template_group AS m ORGANIZATION_SERVICE_TEMPLATE_GROUP AS M
LEFT JOIN LEFT JOIN
template_group AS t ON m.template_group_id = t.ID TEMPLATE_GROUP AS T
ON
M.TEMPLATE_GROUP_ID = T.ID
WHERE WHERE
m.organization_id = #{orgId} M.ORGANIZATION_ID = #{ORGID}
order by m.service_type_id ORDER BY
M.SERVICE_TYPE_ID
</select> </select>
<select id="getOrgnizationServiceTemplateGroupOrgNames" parameterType="java.lang.Long"
resultType="java.lang.String"> <select id="getOrgnizationServiceTemplateGroupOrgNames" parameterType="java.lang.Long" resultType="java.lang.String">
SELECT SELECT
q.Name Q.NAME
FROM FROM
organization_service_template_group p ORGANIZATION_SERVICE_TEMPLATE_GROUP P
LEFT JOIN LEFT JOIN
Organization q ON p.organization_id = q.ID ORGANIZATION Q
ON
P.ORGANIZATION_ID = Q.ID
WHERE WHERE
p.template_group_id = #{templateGroupDtoID,jdbcType=VARCHAR} AND q.IsActive = 1 P.TEMPLATE_GROUP_ID = #{TEMPLATEGROUPDTOID,JDBCTYPE=VARCHAR}
AND Q.IS_ACTIVE = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.OrganizationStructureMapper"> <mapper namespace="pwc.taxtech.atms.dao.OrganizationStructureMapper">
<!-- user defined --> <!-- user defined -->
<insert id="bulkInsert" parameterType="java.util.List"> <insert id="bulkInsert" parameterType="java.util.List">
insert into OrganizationStructure (ID, "Name", IsActive, INSERT INTO
CreateTime, UpdateTime) ORGANIZATION_STRUCTURE (
values ID,
"NAME",
IS_ACTIVE,
CREATE_TIME,
UPDATE_TIME
)
VALUES
<foreach collection="list" index="index" item="item" separator=","> <foreach collection="list" index="index" item="item" separator=",">
(#{item.ID,jdbcType=VARCHAR}, #{item.name,jdbcType=NVARCHAR}, #{item.isActive,jdbcType=SMALLINT}, (
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}) #{item.ID,jdbcType=VARCHAR},
#{item.name,jdbcType=NVARCHAR},
#{item.isActive,jdbcType=SMALLINT},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}
)
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.RolePermissionMapper"> <mapper namespace="pwc.taxtech.atms.dao.RolePermissionMapper">
<select id="selectByRoleId" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByRoleId" parameterType="java.lang.String" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from RolePermission FROM
where RoleId = #{roleId,jdbcType=VARCHAR} ROLE_PERMISSION
WHERE
ROLE_ID = #{roleId,jdbcType=VARCHAR}
</select> </select>
<resultMap extends="BaseResultMap" id="ResultMapWithAssociation" type="pwc.taxtech.atms.entity.RolePermission"> <resultMap extends="BaseResultMap" id="ResultMapWithAssociation" type="pwc.taxtech.atms.entity.RolePermission">
<association column="roleID" javaType="pwc.taxtech.atms.entity.Role" property="role"> <association column="ROLE_ID" javaType="pwc.taxtech.atms.entity.Role" property="role">
<id column="RoleID" property="ID"/> <id column="ROLE_ID" property="ID"/>
<result column="RoleName" property="name"/> <result column="ROLE_NAME" property="name"/>
<result column="RoleDescription" property="description"/> <result column="ROLE_DESCRIPTION" property="description"/>
<result column="RoleCategoryID" property="roleCategoryID"/> <result column="ROLE_CATEGORY_ID" property="roleCategoryId"/>
<result column="RoleServiceType" property="serviceTypeID"/> <result column="ROLE_SERVICE_TYPE" property="serviceTypeId"/>
<result column="RoleCreateTime" property="createTime"/> <result column="ROLE_CREATE_TIME" property="createTime"/>
<result column="RoleUpdateTime" property="updateTime"/> <result column="ROLE_UPDATE_TIME" property="updateTime"/>
</association> </association>
<association column="permissionID" javaType="pwc.taxtech.atms.entity.Permission" property="permission"> <association column="PERMISSION_ID" javaType="pwc.taxtech.atms.entity.Permission" property="permission">
<id column="PermissionID" property="ID"/> <id column="PERMISSION_ID" property="ID"/>
<result column="PermissionName" property="name"/> <result column="PERMISSION_NAME" property="name"/>
<result column="PermissionCode" property="code"/> <result column="PERMISSION_CODE" property="code"/>
<result column="PermissionParentID" property="parentId"/> <result column="PERMISSION_PARENT_ID" property="parentId"/>
<result column="PermissionIsActive" property="isActive"/> <result column="PERMISSION_IS_ACTIVE" property="isActive"/>
<result column="PermissionPLevel" property="PLevel"/> <result column="PERMISSION_P_LEVEL" property="pLevel"/>
<result column="PermissionRelyOnCodes" property="relyOnCodes"/> <result column="PERMISSION_RELY_ON_CODES" property="relyOnCodes"/>
<result column="PermissionMenuID" property="menuID"/> <result column="PERMISSION_MENU_ID" property="menuId"/>
<result column="PermissionServiceTypeID" property="serviceTypeID"/> <result column="PERMISSION_SERVICE_TYPE_ID" property="serviceTypeId"/>
<result column="PermissionCreateTime" property="createTime"/> <result column="PERMISSION_CREATE_TIME" property="createTime"/>
<result column="PermissionUpdateTime" property="updateTime"/> <result column="PERMISSION_UPDATE_TIME" property="updateTime"/>
</association> </association>
</resultMap> </resultMap>
<select id="selectByRoleAndServiceTypeWithAssociation" resultMap="ResultMapWithAssociation"> <select id="selectByRoleAndServiceTypeWithAssociation" resultMap="ResultMapWithAssociation">
select SELECT
rp.ID as ID, rp.RoleID, rp.PermissionID, RP.ID AS ID,
r.ID as RoleID, r.Name as RoleName, r.Description as RoleDescription, r.RoleCategoryID as RoleCategoryID, rp.ROLE_ID,
r.ServiceTypeID as RoleServiceType, r.CreateTime as RoleCreateTime, r.UpdateTime as RoleUpdateTime, rp.PERMISSION_ID,
p.ID as permissionID, p.Name as PermissionName, p.Code as PermissionCode, p.ParentID as PermissionParentID, r.ID AS ROLE_ID,
p.IsActive as PermissionIsActive, r.NAME AS ROLE_NAME,
p.PLevel as PermissionPLevel, p.RelyOnCodes as PermissionRelyOnCodes, p.MenuID as PermissionMenuID, r.DESCRIPTION AS ROLE_DESCRIPTION,
p.ServiceTypeID as PermissionServiceTypeID, p.CreateTime as PermissionCreateTime, p.UpdateTime as r.ROLE_CATEGORY_ID AS ROLE_CATEGORY_ID,
PermissionUpdateTime r.SERVICE_TYPE_ID AS ROLE_SERVICE_TYPE,
from RolePermission rp r.CREATE_TIME AS ROLE_CREATE_TIME,
join Role r on r.ID = rp.RoleID r.UPDATE_TIME AS ROLE_UPDATE_TIME,
join Permission p on p.ID = rp.PermissionID p.ID AS PERMISSION_ID,
where rp.RoleID=#{roleID,jdbcType=VARCHAR} and r.ServiceTypeID=#{serviceTypeID,jdbcType=VARCHAR} p.NAME AS PERMISSION_NAME,
p.CODE AS PERMISSION_CODE,
p.PARENT_ID AS PERMISSION_PARENT_ID,
p.IS_ACTIVE AS PERMISSION_IS_ACTIVE,
p.P_LEVEL AS PERMISSION_P_LEVEL,
p.RELY_ON_CODES AS PERMISSION_RELY_ON_CODES,
p.MENU_ID AS PERMISSION_MENU_ID,
p.SERVICE_TYPE_ID AS PERMISSION_SERVICE_TYPE_ID,
p.CREATE_TIME AS PERMISSION_CREATE_TIME,
p.UPDATE_TIME AS PERMISSION_UPDATE_TIME
FROM
ROLE_PERMISSION rp
JOIN
ROLE r
on
r.ID = rp.ROLE_ID
JOIN
PERMISSION p
on
p.ID = rp.PERMISSION_ID
where
rp.ROLE_ID_= #{roleID,jdbcType=VARCHAR}
AND R.SERVICE_TYPE_ID_= #{serviceTypeID,jdbcType=VARCHAR}
</select> </select>
<select id="selectByRoleListAndServiceTypeWithAssociation" resultMap="ResultMapWithAssociation"> <select id="selectByRoleListAndServiceTypeWithAssociation" resultMap="ResultMapWithAssociation">
select SELECT
rp.ID as ID, rp.RoleID, rp.PermissionID, RP.ID AS ID,
r.ID as RoleID, r.Name as RoleName, r.Description as RoleDescription, r.RoleCategoryID as RoleCategoryID, rp.ROLE_ID,
r.ServiceTypeID as RoleServiceType, r.CreateTime as RoleCreateTime, r.UpdateTime as RoleUpdateTime, rp.PERMISSION_ID,
p.ID as permissionID, p.Name as PermissionName, p.Code as PermissionCode, p.ParentID as PermissionParentID, r.ID AS ROLE_ID,
p.IsActive as PermissionIsActive, r.NAME AS ROLE_NAME,
p.PLevel as PermissionPLevel, p.RelyOnCodes as PermissionRelyOnCodes, p.MenuID as PermissionMenuID, r.DESCRIPTION AS ROLE_DESCRIPTION,
p.ServiceTypeID as PermissionServiceTypeID, p.CreateTime as PermissionCreateTime, p.UpdateTime as r.ROLE_CATEGORY_ID AS ROLE_CATEGORY_ID,
PermissionUpdateTime r.SERVICE_TYPE_ID AS ROLE_SERVICE_TYPE,
from RolePermission rp r.CREATE_TIME AS ROLE_CREATE_TIME,
join Role r on r.ID = rp.RoleID r.UPDATE_TIME AS ROLE_UPDATE_TIME,
join Permission p on p.ID = rp.PermissionID p.ID AS PERMISSION_ID,
where r.ServiceTypeID=#{serviceTypeID,jdbcType=VARCHAR} and rp.RoleID in p.NAME AS PERMISSION_NAME,
p.CODE AS PERMISSION_CODE,
p.PARENT_ID AS PERMISSION_PARENT_ID,
p.IS_ACTIVE AS PERMISSION_IS_ACTIVE,
p.P_LEVEL AS PERMISSION_P_LEVEL,
p.RELY_ON_CODES AS PERMISSION_RELY_ON_CODES,
p.MENU_ID AS PERMISSION_MENU_ID,
p.SERVICE_TYPE_ID AS PERMISSION_SERVICE_TYPE_ID,
p.CREATE_TIME AS PERMISSION_CREATE_TIME,
p.UPDATE_TIME AS PERMISSION_UPDATE_TIME
FROM
ROLE_PERMISSION rp
JOIN
ROLE r
on
r.ID = rp.ROLE_ID
JOIN
PERMISSION p
on
p.ID = rp.PERMISSION_ID
where
r.SERVICE_TYPE_ID_= #{serviceTypeID,jdbcType=VARCHAR}
AND RP.ROLE_ID in
<foreach close=")" collection="roleList" index="index" item="roleID" open="(" separator=","> <foreach close=")" collection="roleList" index="index" item="roleID" open="(" separator=",">
#{roleID} #{roleID}
</foreach> </foreach>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.TemplateMapper"> <mapper namespace="pwc.taxtech.atms.dao.TemplateMapper">
<resultMap id="TemplateUniqDto" type="pwc.taxtech.atms.dto.TemplateUniqDto"> <resultMap id="TemplateUniqDto" type="pwc.taxtech.atms.dto.TemplateUniqDto">
<id column="id" jdbcType="INTEGER" property="id"/> <id column="ID" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/> <result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="order_index" jdbcType="INTEGER" property="orderIndex"/> <result column="ORDER_INDEX" jdbcType="INTEGER" property="orderIndex"/>
<result column="report_type" jdbcType="INTEGER" property="reportType"/> <result column="REPORT_TYPE" jdbcType="INTEGER" property="reportType"/>
<result column="template_group_id" jdbcType="VARCHAR" property="templateGroupId"/> <result column="TEMPLATE_GROUP_ID" jdbcType="VARCHAR" property="templateGroupId"/>
<result column="template_group_name" jdbcType="VARCHAR" property="templateGroupName"/> <result column="TEMPLATE_GROUP_NAME" jdbcType="VARCHAR" property="templateGroupName"/>
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/> <result column="PARENT_ID" jdbcType="VARCHAR" property="parentId"/>
<result column="parent_name" jdbcType="VARCHAR" property="parentName"/> <result column="PARENT_NAME" jdbcType="VARCHAR" property="parentName"/>
<result column="pay_tax_type" jdbcType="INTEGER" property="payTaxType"/> <result column="PAY_TAX_TYPE" jdbcType="INTEGER" property="payTaxType"/>
<result column="industry_ids" jdbcType="VARCHAR" property="industryIds"/> <result column="INDUSTRY_IDS" jdbcType="VARCHAR" property="industryIds"/>
<result column="service_type_id" jdbcType="VARCHAR" property="serviceTypeId"/> <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId"/>
<result column="is_active_association" jdbcType="INTEGER" property="isActiveAssociation"/> <result column="IS_ACTIVE_ASSOCIATION" jdbcType="INTEGER" property="isActiveAssociation"/>
</resultMap> </resultMap>
<select id="getTemplateUniqDtosByTemplateAndTemplateGroup" parameterType="map" resultMap="TemplateUniqDto"> <select id="getTemplateUniqDtosByTemplateAndTemplateGroup" parameterType="map" resultMap="TemplateUniqDto">
SELECT p.id,p.code,p.name,p.report_type,q.id as template_group_id,q.name as SELECT
template_group_name,p.is_active_association P.ID,
FROM template p join template_group q on p.template_group_id=q.id p.CODE,
p.NAME,
P.REPORT_TYPE,
Q.ID AS TEMPLATE_GROUP_ID,
Q.NAME AS TEMPLATE_GROUP_NAME,
P.IS_ACTIVE_ASSOCIATION
FROM
TEMPLATE P
JOIN
TEMPLATE_GROUP Q
ON
P.TEMPLATE_GROUP_ID=Q.ID
<where> <where>
1=1 1=1
<if test="serviceTypeId!=null"> <if test="serviceTypeId!=null">
AND q.service_type_id=#{serviceTypeId,jdbcType=VARCHAR} AND Q.service_type_id= #{serviceTypeId,jdbcType=VARCHAR}
</if> </if>
<if test="payTaxType!=null"> <if test="payTaxType!=null">
AND q.pay_tax_type = #{payTaxType,jdbcType=INTEGER} AND Q.pay_tax_type = #{payTaxType,jdbcType=INTEGER}
</if> </if>
<if test="reportType!=null"> <if test="reportType!=null">
AND p.report_type =#{reportType,jdbcType=INTEGER} AND P.report_type = #{reportType,jdbcType=INTEGER}
</if> </if>
<if test="industryIds!=null"> <if test="industryIds!=null">
AND q.industry_ids =#{industryID,jdbcType=VARCHAR} AND Q.industry_ids = #{industryID,jdbcType=VARCHAR}
</if> </if>
</where> </where>
ORDER BY p.template_group_id, p.order_index ORDER BY
P.TEMPLATE_GROUP_ID,
P.ORDER_INDEX
</select> </select>
<resultMap id="TemplateAndGroupDbDto" type="pwc.taxtech.atms.dto.TemplateAndGroupDbDto"> <resultMap id="TemplateAndGroupDbDto" type="pwc.taxtech.atms.dto.TemplateAndGroupDbDto">
<id column="id" jdbcType="VARCHAR" property="templateId"/> <id column="ID" jdbcType="VARCHAR" property="templateId"/>
<result column="template_group_id" jdbcType="VARCHAR" property="templateGroupId"/> <result column="TEMPLATE_GROUP_ID" jdbcType="VARCHAR" property="templateGroupId"/>
<result column="template_code" jdbcType="VARCHAR" property="templateCode"/> <result column="TEMPLATE_CODE" jdbcType="VARCHAR" property="templateCode"/>
</resultMap> </resultMap>
<select id="getTemplateAndGroupByID" parameterType="java.lang.String" resultMap="TemplateAndGroupDbDto"> <select id="getTemplateAndGroupByID" parameterType="java.lang.String" resultMap="TemplateAndGroupDbDto">
SELECT p.id as id,q.id as template_group_id,p.code as template_code FROM template p JOIN template_group q on SELECT
p.template_group_id=q.id WHERE p.id=#{id,jdbcType=VARCHAR} LIMIT 1 P.ID AS ID,
Q.ID AS TEMPLATE_GROUP_ID,
P.CODE AS TEMPLATE_CODE
FROM
TEMPLATE P
JOIN
TEMPLATE_GROUP Q
ON
P.TEMPLATE_GROUP_ID=Q.ID
WHERE
p.ID_= #{id,jdbcType=VARCHAR} LIMIT 1
</select> </select>
<select id="getCountOfTemplateAndGroupByTemplateName" parameterType="map" resultType="java.lang.Long"> <select id="getCountOfTemplateAndGroupByTemplateName" parameterType="map" resultType="java.lang.Long">
SELECT COUNT(1) FROM template p join template_group q on p.template_group_id=q.id SELECT
COUNT (
1
)
FROM
TEMPLATE P
JOIN
TEMPLATE_GROUP Q
ON
P.TEMPLATE_GROUP_ID=Q.ID
<where> <where>
1=1 1=1
<if test="templateGroupId!=null"> <if test="templateGroupId!=null">
AND q.id = #{templateGroupId,jdbcType=VARCHAR} AND Q.ID = #{templateGroupId,jdbcType=VARCHAR}
</if> </if>
<if test="templateId!=null"> <if test="templateId!=null">
AND p.id&lt;&gt;#{templateId,jdbcType=VARCHAR} AND P.ID_&lt;&gt; #{templateId,jdbcType=VARCHAR}
</if> </if>
<if test="templateName!=null"> <if test="templateName!=null">
AND p.Name= #{templateName,jdbcType=VARCHAR} AND P.NAME_= #{templateName,jdbcType=VARCHAR}
</if> </if>
</where> </where>
</select> </select>
<resultMap id="reportDto" type="pwc.taxtech.atms.dto.vatdto.ReportDto"> <resultMap id="reportDto" type="pwc.taxtech.atms.dto.vatdto.ReportDto">
<id column="id" jdbcType="VARCHAR" property="id"/> <id column="ID" jdbcType="VARCHAR" property="id"/>
<result column="period" jdbcType="INTEGER" property="period"/> <result column="PERIOD" jdbcType="INTEGER" property="period"/>
<result column="template_id" jdbcType="INTEGER" property="templateId"/> <result column="TEMPLATE_ID" jdbcType="INTEGER" property="templateId"/>
<result column="template_name" jdbcType="VARCHAR" property="templateName"/> <result column="TEMPLATE_NAME" jdbcType="VARCHAR" property="templateName"/>
<result column="template_code" jdbcType="VARCHAR" property="templateCode"/> <result column="TEMPLATE_CODE" jdbcType="VARCHAR" property="templateCode"/>
</resultMap> </resultMap>
<select id="getTemplateLeftJoinReport" parameterType="map" resultMap="reportDto"> <select id="getTemplateLeftJoinReport" parameterType="map" resultMap="reportDto">
SELECT SELECT
d.id AS id, D.ID AS ID,
d.period AS period, D.PERIOD AS PERIOD,
c.id AS template_id, C.ID AS TEMPLATE_ID,
c.name AS template_name, C.NAME AS TEMPLATE_NAME,
c.code AS template_code C.CODE AS TEMPLATE_CODE
FROM (SELECT FROM
a.id, (
a.name, SELECT
a.code A.ID,
FROM tax_admin.template a A.NAME,
WHERE a.template_group_id = #{templateGroupID,jdbcType=VARCHAR} A.CODE
AND a.is_active_association = 1 FROM
ORDER BY a.order_index) c TAX_ADMIN.TEMPLATE A
LEFT JOIN (SELECT b.id,b.period,b.template_id WHERE
FROM ${dbName}.report b A.TEMPLATE_GROUP_ID = #{templateGroupID,jdbcType=VARCHAR}
WHERE b.period = #{period,jdbcType=INTEGER} AND A.IS_ACTIVE_ASSOCIATION = 1
AND b.project_id = #{projectID,jdbcType=VARCHAR}) d ORDER BY
ON c.id = d.template_id A.ORDER_INDEX
ORDER BY template_code )
C
LEFT JOIN
(
SELECT
B.ID,
B.PERIOD,
B.TEMPLATE_ID
FROM
${DB_NAME_}.REPORT b
WHERE
b.PERIOD = #{period,jdbcType=INTEGER}
AND B.PROJECT_ID = #{projectID,jdbcType=VARCHAR}
)
D
ON
C.ID = D.TEMPLATE_ID
ORDER BY
TEMPLATE_CODE
</select> </select>
<select id="getIDsForExceptTemplate" resultType="java.lang.Long"> <select id="getIDsForExceptTemplate" resultType="java.lang.Long">
SELECT SELECT
a.id A.ID
FROM FROM
template a TEMPLATE A
JOIN template_group b ON a.template_group_id = b.id JOIN
TEMPLATE_GROUP B
ON
A.TEMPLATE_GROUP_ID = B.ID
WHERE WHERE
b.group_type = 2 B.GROUP_TYPE = 2
AND b.service_type_id = 2 AND B.SERVICE_TYPE_ID = 2
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserDimensionValueMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserDimensionValueMapper">
<select id="getUserDimensionValueList" resultMap="BaseResultMap">
select
q.ID as ID,
q.UserID as UserID,
q.DimensionID as DimensionID,
q.DimensionValueID as DimensionValueID,
q.HasOriginalRole as HasOriginalRole,
q.IsAccessible as IsAccessible
from UserDimensionValue as q <select id="getUserDimensionValueList" resultMap="BaseResultMap">
join "USER" as u on q.UserID = u.ID and u.Status =1 SELECT
Q.ID AS ID,
q.USER_ID AS USER_ID,
q.DIMENSION_ID AS DIMENSION_ID,
q.DIMENSION_VALUE_ID AS DIMENSION_VALUE_ID,
q.HAS_ORIGINAL_ROLE AS HAS_ORIGINAL_ROLE,
q.IS_ACCESSIBLE AS IS_ACCESSIBLE
FROM
USER_DIMENSION_VALUE AS Q
JOIN
"USER" AS U
on
q.USER_ID = u.ID
AND U.STATUS =1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserDimensionValueRoleMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserDimensionValueRoleMapper">
<resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto"> <resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="RoleID" jdbcType="VARCHAR" property="roleID"/> <result column="ROLE_ID" jdbcType="VARCHAR" property="roleId"/>
<result column="RoleName" jdbcType="VARCHAR" property="roleName"/> <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
</resultMap> </resultMap>
<select id="getUserDimensionValueRoleList" resultMap="UserOrgRoleDto">
select
udv.UserDimensionValueID as ID,
udv.RoleID as RoleID,
r.Name as RoleName
from UserDimensionValueRole as udv <select id="getUserDimensionValueRoleList" resultMap="UserOrgRoleDto">
join Role as r on udv.RoleID = r.ID SELECT
UDV.USER_DIMENSION_VALUE_ID AS ID,
udv.ROLE_ID AS ROLE_ID,
r.NAME AS ROLE_NAME
FROM
USER_DIMENSION_VALUE_ROLE AS UDV
JOIN
ROLE AS R
on
udv.ROLE_ID = r.ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserMapper">
<select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- select one record by user name --> <!-- select one record by user name -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from User FROM
where UserName = #{userName,jdbcType=VARCHAR} USER
WHERE
USER_NAME = #{userName,jdbcType=VARCHAR}
</select> </select>
<select id="selectByUserNameIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByUserNameIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- select one record by user name --> <!-- select one record by user name -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from User FROM
where lower(UserName) = lower(#{userName,jdbcType=VARCHAR}) USER
WHERE
LOWER (
USER_NAME
)
= LOWER (
#{userName,jdbcType=VARCHAR}
)
</select> </select>
<select id="selectUserWithSameUserName" parameterType="pwc.taxtech.atms.dpo.UserDto" resultMap="BaseResultMap"> <select id="selectUserWithSameUserName" parameterType="pwc.taxtech.atms.dpo.UserDto" resultMap="BaseResultMap">
<!-- select one record by user name and different ID --> <!-- select one record by user name and different ID -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from User FROM
where lower(UserName) = lower(#{userName}) USER
and ID != #{ID} WHERE
LOWER (
USER_NAME
)
= LOWER (
#{userName}
)
AND ID != #{ID}
</select> </select>
<select id="selectUserWithSameEmail" parameterType="pwc.taxtech.atms.dpo.UserDto" resultMap="BaseResultMap"> <select id="selectUserWithSameEmail" parameterType="pwc.taxtech.atms.dpo.UserDto" resultMap="BaseResultMap">
<!-- select one record by email and different ID --> <!-- select one record by email and different ID -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from User FROM
where lower(Email) = lower(#{email}) USER
and ID != #{ID} WHERE
LOWER (
EMAIL
)
= LOWER (
#{email}
)
AND ID != #{ID}
</select> </select>
<select id="selectByEmailIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByEmailIgnoreCase" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- select one record by email --> <!-- select one record by email -->
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from User FROM
where lower(Email) = lower(#{email}) USER
WHERE
LOWER (
EMAIL
)
= LOWER (
#{email}
)
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserOrganizationMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserOrganizationMapper">
<select id="getUserOrganizationList" resultMap="BaseResultMap">
select
q.ID as ID,
q.UserID as UserID,
q.OrganizationID as OrganizationID,
q.IsAccessible as IsAccessible,
q.HasOriginalRole as HasOriginalRole
from UserOrganization as q
join "USER" as u on q.UserID = u.ID
where u.Status =1 <select id="getUserOrganizationList" resultMap="BaseResultMap">
SELECT
Q.ID AS ID,
q.USER_ID AS USER_ID,
q.ORGANIZATION_ID AS ORGANIZATION_ID,
q.IS_ACCESSIBLE AS IS_ACCESSIBLE,
q.HAS_ORIGINAL_ROLE AS HAS_ORIGINAL_ROLE
FROM
USER_ORGANIZATION AS Q
JOIN
"USER" AS U
on
q.USER_ID = u.ID
where
u.STATUS =1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserOrganizationRoleMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserOrganizationRoleMapper">
<resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto"> <resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="RoleID" jdbcType="VARCHAR" property="roleID"/> <result column="ROLE_ID" jdbcType="VARCHAR" property="roleId"/>
<result column="RoleName" jdbcType="VARCHAR" property="roleName"/> <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
</resultMap> </resultMap>
<select id="getUserOrganizationRoleList" resultMap="UserOrgRoleDto">
select
q.UserOrganizationID as ID,
q.RoleID as RoleID,
r.Name as RoleName
from UserOrganizationRole as q <select id="getUserOrganizationRoleList" resultMap="UserOrgRoleDto">
join Role as r on q.RoleID = r.ID SELECT
Q.USER_ORGANIZATION_ID AS ID,
q.ROLE_ID AS ROLE_ID,
r.NAME AS ROLE_NAME
FROM
USER_ORGANIZATION_ROLE AS Q
JOIN
ROLE AS R
on
q.ROLE_ID = r.ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserRoleMapper"> <mapper namespace="pwc.taxtech.atms.dao.UserRoleMapper">
<resultMap id="UserRoleQuery" type="pwc.taxtech.atms.dto.user.UserRoleQuery"> <resultMap id="UserRoleQuery" type="pwc.taxtech.atms.dto.user.UserRoleQuery">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="UserID" jdbcType="VARCHAR" property="userID"/> <result column="USER_ID" jdbcType="VARCHAR" property="userId"/>
<result column="UserName" jdbcType="VARCHAR" property="userName"/> <result column="USER_NAME" jdbcType="VARCHAR" property="userName"/>
<result column="RoleID" jdbcType="VARCHAR" property="roleID"/> <result column="ROLE_ID" jdbcType="VARCHAR" property="roleId"/>
<result column="RoleName" jdbcType="VARCHAR" property="roleName"/> <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
<result column="ServiceTypeName" jdbcType="VARCHAR" property="serviceTypeName"/> <result column="SERVICE_TYPE_NAME" jdbcType="VARCHAR" property="serviceTypeName"/>
<result column="ServiceTypeID" jdbcType="VARCHAR" property="serviceTypeID"/> <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId"/>
<result column="RoleCategoryID" jdbcType="VARCHAR" property="roleCategoryID"/> <result column="ROLE_CATEGORY_ID" jdbcType="VARCHAR" property="roleCategoryId"/>
<result column="RoleCatetoryName" jdbcType="VARCHAR" property="roleCatetoryName"/> <result column="ROLE_CATETORY_NAME" jdbcType="VARCHAR" property="roleCatetoryName"/>
<result column="OrgID" jdbcType="VARCHAR" property="orgID"/> <result column="ORG_ID" jdbcType="VARCHAR" property="orgId"/>
<result column="OrgName" jdbcType="VARCHAR" property="orgName"/> <result column="ORG_NAME" jdbcType="VARCHAR" property="orgName"/>
<result column="Email" jdbcType="VARCHAR" property="email"/> <result column="EMAIL" jdbcType="VARCHAR" property="email"/>
<result column="Status" jdbcType="INTEGER" property="status"/> <result column="STATUS" jdbcType="INTEGER" property="status"/>
</resultMap> </resultMap>
<select id="selectUserRoleQueryByServiceTypeId" parameterType="java.lang.String" resultMap="UserRoleQuery"> <select id="selectUserRoleQueryByServiceTypeId" parameterType="java.lang.String" resultMap="UserRoleQuery">
select ur.ID as ID, u.ID as UserID, u.UserName as UserName, ur.RoleID as RoleID, SELECT UR
r.Name as RoleName, s.Name as ServiceTypeName, s.ID as ServiceTypeID, rc.ID as RoleCategoryID, .ID AS ID,
rc.Name as RoleCatetoryName, org.ID as OrgID, org.Name as OrgName, u.Email as Email, u.Status as Status from u.ID AS USER_ID,
User as u u.USER_NAME AS USER_NAME, ur
left join UserRole as ur on u.ID = ur.UserID .ROLE_ID AS ROLE_ID,
left join Role as r on ur.RoleID = r.ID r.NAME AS ROLE_NAME,
left join ServiceType as s on s.ID = r.ServiceTypeID and s.IsActive = 1 and s.ID = #{serviceTypeID} s.NAME AS SERVICE_TYPE_NAME,
left join RoleCategory as rc on rc.ID = r.RoleCategoryID and rc.IsActive = 1 s.ID AS SERVICE_TYPE_ID,
left join Organization as org on u.OrganizationID = org.ID rc.ID AS ROLE_CATEGORY_ID,
where u.Status = 1 and u.IsSuperAdmin = 0 rc.NAME AS ROLE_CATETORY_NAME,
order by UserName org.ID AS ORG_ID,
org.NAME AS ORG_NAME,
u.EMAIL AS EMAIL,
u.STATUS AS STATUS
FROM
USER AS U
left JOIN
USER_ROLE AS UR
on
u.ID = ur
.USER_ID
left JOIN
ROLE AS R
on ur
.ROLE_ID = r.ID
left JOIN
SERVICE_TYPE AS S
on
s.ID = r.SERVICE_TYPE_ID
AND S.IS_ACTIVE = 1
AND S.ID = #{serviceTypeID}
left JOIN
ROLE_CATEGORY AS RC
on
rc.ID = r.ROLE_CATEGORY_ID
AND RC.IS_ACTIVE = 1
left JOIN
ORGANIZATION AS ORG
on
u.ORGANIZATION_ID = org.ID
where
u.STATUS = 1
AND U.IS_SUPER_ADMIN = 0
order by
UserName
</select> </select>
<resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto"> <resultMap id="UserOrgRoleDto" type="pwc.taxtech.atms.dpo.UserOrgRoleDto">
<id column="ID" jdbcType="VARCHAR" property="ID"/> <id column="ID" jdbcType="VARCHAR" property="ID"/>
<result column="UserID" jdbcType="VARCHAR" property="userID"/> <result column="USER_ID" jdbcType="VARCHAR" property="userId"/>
<result column="RoleID" jdbcType="VARCHAR" property="roleID"/> <result column="ROLE_ID" jdbcType="VARCHAR" property="roleId"/>
<result column="RoleName" jdbcType="VARCHAR" property="roleName"/> <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
</resultMap> </resultMap>
<select id="getOriginalRoleList" resultMap="UserOrgRoleDto"> <select id="getOriginalRoleList" resultMap="UserOrgRoleDto">
select ur.UserID as UserID, SELECT UR
r.ID as RoleID, r.Name as RoleName .USER_ID AS USER_ID,
from UserRole as ur r.ID AS ROLE_ID,
join Role as r on ur.RoleID = r.ID r.NAME AS ROLE_NAME
FROM
USER_ROLE AS UR
JOIN
ROLE AS R
on ur
.ROLE_ID = r.ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.BalanceMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.BalanceMapper">
<select id="getSumOfBalance" resultType="java.math.BigDecimal"> <select id="getSumOfBalance" resultType="java.math.BigDecimal">
SELECT IFNULL(SUM((IFNULL(a.DebitNet,0)-IFNULL(a.CreditNet,0))*#{direction,,jdbcType=INTEGER}),0) FROM Balance a SELECT
WHERE a.AcctCode=#{acctCode,jdbcType=VARCHAR} IFNULL (
SUM (
(
IFNULL (
a.DEBIT_NET,
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0
)
FROM
BALANCE a
WHERE
a.ACCT_CODE_= #{acctCode,jdbcType=VARCHAR}
<if test="period!=99"> <if test="period!=99">
AND PeriodId=#{period,jdbcType=INTEGER} AND PERIOD_ID_= #{period,jdbcType=INTEGER}
</if> </if>
</select> </select>
<select id="getFirstOfBalance" resultType="java.math.BigDecimal"> <select id="getFirstOfBalance" resultType="java.math.BigDecimal">
SELECT IFNULL(((IFNULL(a.DebitNet,0)-IFNULL(a.CreditNet,0))*#{direction,,jdbcType=INTEGER}),0) FROM Balance a SELECT
WHERE a.AcctCode=#{acctCode,jdbcType=VARCHAR} LIMIT 1 IFNULL (
(
(
IFNULL (
a.DEBIT_NET,
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0
)
FROM
BALANCE a
WHERE
a.ACCT_CODE_= #{acctCode,jdbcType=VARCHAR} LIMIT 1
<if test="period!=99"> <if test="period!=99">
AND PeriodId=#{period,jdbcType=INTEGER} AND PERIOD_ID_= #{period,jdbcType=INTEGER}
</if> </if>
</select> </select>
<select id="getFirstWithDbNameAndAccountCodeAndPeriod" resultMap="BaseResultMap"> <select id="getFirstWithDbNameAndAccountCodeAndPeriod" resultMap="BaseResultMap">
SELECT * FROM ${dbName}.Balance a WHERE a.AcctCode=${accountCode,jdbcType=VARCHAR} AND SELECT
a.PeriodId=${period,jdbcType=INTEGER} LIMIT 1 *
FROM
$_{DB_NAME_}.BALANCE a
WHERE
a.ACCT_CODE_= ${accountCode,jdbcType=VARCHAR}
AND A.PERIOD_ID_= ${period,jdbcType=INTEGER} LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.BalanceStdManualMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.BalanceStdManualMapper">
<select id="selectOneWithAccountCodeAndDBName" resultMap="BaseResultMap"> <select id="selectOneWithAccountCodeAndDBName" resultMap="BaseResultMap">
SELECT * FROM ${dbName}.BalanceStdManual a SELECT
*
FROM
$_{DB_NAME_}.BALANCE_STD_MANUAL a
WHERE WHERE
a.AcctCode=#{accountCode,jdbcType=VARCHAR} AND a.PeriodID=#{period,jdbcType=INTEGER} a.ACCT_CODE_= #{accountCode,jdbcType=VARCHAR}
LIMIT 1 AND A.PERIOD_ID_= #{period,jdbcType=INTEGER} LIMIT 1
</select> </select>
<select id="selectOneWithAccountCode" resultMap="BaseResultMap"> <select id="selectOneWithAccountCode" resultMap="BaseResultMap">
SELECT * FROM BalanceStdManual a SELECT
*
FROM
BALANCE_STD_MANUAL a
WHERE WHERE
a.AcctCode=#{accountCode,jdbcType=VARCHAR} AND a.PeriodID=#{period,jdbcType=INTEGER} a.ACCT_CODE_= #{accountCode,jdbcType=VARCHAR}
LIMIT 1 AND A.PERIOD_ID_= #{period,jdbcType=INTEGER} LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.CompanyBalanceMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.CompanyBalanceMapper">
<resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.dto.vatdto.TrialBalanceDto"> <resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.dto.vatdto.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/> <id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
<result column="PeriodId" jdbcType="INTEGER" property="periodId"/> <result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/>
<result column="AcctCode" jdbcType="VARCHAR" property="acctCode"/> <result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/>
<result column="CustomerCode" jdbcType="VARCHAR" property="customerCode"/> <result column="CUSTOMER_CODE" jdbcType="VARCHAR" property="customerCode"/>
<result column="BegDebitBal" jdbcType="DECIMAL" property="begDebitBal"/> <result column="BEG_DEBIT_BAL" jdbcType="DECIMAL" property="begDebitBal"/>
<result column="BegCreditBal" jdbcType="DECIMAL" property="begCreditBal"/> <result column="BEG_CREDIT_BAL" jdbcType="DECIMAL" property="begCreditBal"/>
<result column="BegBal" jdbcType="DECIMAL" property="begBal"/> <result column="BEG_BAL" jdbcType="DECIMAL" property="begBal"/>
<result column="EndBal" jdbcType="DECIMAL" property="endBal"/> <result column="END_BAL" jdbcType="DECIMAL" property="endBal"/>
<result column="EndDebitBal" jdbcType="DECIMAL" property="endDebitBal"/> <result column="END_DEBIT_BAL" jdbcType="DECIMAL" property="endDebitBal"/>
<result column="EndCreditBal" jdbcType="DECIMAL" property="endCreditBal"/> <result column="END_CREDIT_BAL" jdbcType="DECIMAL" property="endCreditBal"/>
<result column="DebitBal" jdbcType="DECIMAL" property="debitBal"/> <result column="DEBIT_BAL" jdbcType="DECIMAL" property="debitBal"/>
<result column="CreditBal" jdbcType="DECIMAL" property="creditBal"/> <result column="CREDIT_BAL" jdbcType="DECIMAL" property="creditBal"/>
<result column="MonthId" jdbcType="INTEGER" property="monthId"/> <result column="MONTH_ID" jdbcType="INTEGER" property="monthId"/>
<result column="AccountName" jdbcType="VARCHAR" property="accountName"/> <result column="ACCOUNT_NAME" jdbcType="VARCHAR" property="accountName"/>
</resultMap> </resultMap>
<select id="companyBalanceLeftJoinEnterpriseAccount" resultMap="TrialBalanceDto"> <select id="companyBalanceLeftJoinEnterpriseAccount" resultMap="TrialBalanceDto">
SELECT DISTINCT SELECT DISTINCT
b.BalanceId, b.BALANCE_ID,
b.PeriodId, b.PERIOD_ID,
b.AcctCode, b.ACCT_CODE,
b.CustomerCode, b.CUSTOMER_CODE,
b.BegDebitBal, b.BEG_DEBIT_BAL,
b.BegCreditBal, b.BEG_CREDIT_BAL,
b.BegBal, b.BEG_BAL,
b.EndBal, b.END_BAL,
b.EndDebitBal, b.END_DEBIT_BAL,
b.EndCreditBal, b.END_CREDIT_BAL,
b.DebitBal, b.DEBIT_BAL,
b.CreditBal, b.CREDIT_BAL,
b.MonthId, b.MONTH_ID,
IF ( IF (
ISNULL(a.ParentCode) || a.ParentCode = '', ISNULL (
a.PARENT_CODE
)
|| a.PARENT_CODE = '',
'0', '0',
a.ParentCode a.PARENT_CODE
) AS ParentCode, )
a.`Name` AS AccountName, AS PARENT_CODE,
a.AcctProp, a.`_NAME_` AS ACCOUNT_NAME,
a.Direction a.ACCT_PROP,
a.DIRECTION
FROM FROM
CompanyBalance b COMPANY_BALANCE b
LEFT JOIN EnterpriseAccount a ON b.AcctCode = a.AcctCode LEFT JOIN
WHERE 1=1 ENTERPRISE_ACCOUNT a
ON
b.ACCT_CODE = a.ACCT_CODE
WHERE
1=1
<if test="fromMonth!=null"> <if test="fromMonth!=null">
AND b.PeriodID &gt;= #{fromMonth,jdbcType=VARCHAR} AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR}
</if> </if>
<if test="toMonth!=null"> <if test="toMonth!=null">
AND b.PeriodID &lt;= #{toMonth,jdbcType=VARCHAR} AND B.PERIOD_ID &lt;= #{toMonth,jdbcType=VARCHAR}
</if> </if>
ORDER BY ORDER BY
b.PeriodID b.PERIOD_ID
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper">
<update id="updateReportId"> <update id="updateReportId">
update period_formula_block UPDATE
set report_id=#{reportId,jdbcType=BIGINT} PERIOD_FORMULA_BLOCK
where period=#{period,jdbcType=INTEGER} and cell_template_id in SET
REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND CELL_TEMPLATE_ID IN
<foreach collection="cellTemplateConfigIds" open="(" close=")" separator="," item="item"> <foreach collection="cellTemplateConfigIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
</update> </update>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodTaxRuleSettingMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.PeriodTaxRuleSettingMapper">
<select id="getTaxRuleSetting" resultMap="BaseResultMap"> <select id="getTaxRuleSetting" resultMap="BaseResultMap">
SELECT SELECT
trs.is_default as is_default, TRS.IS_DEFAULT AS IS_DEFAULT,
trs.tax_base as tax_base, TRS.TAX_BASE AS TAX_BASE,
trs.tax_rate as tax_rate TRS.TAX_RATE AS TAX_RATE
FROM period_tax_rule_setting trs FROM
LEFT JOIN period_tax_rule_setting_organization trso PERIOD_TAX_RULE_SETTING TRS
ON trs.tax_rule_setting_id = trso.tax_setting_id LEFT JOIN
WHERE (trs.is_default = 1 PERIOD_TAX_RULE_SETTING_ORGANIZATION TRSO
OR trso.organization_id = #{organizationId,jdbcType=VARCHAR}) ON
AND trs.name = #{taxName,jdbcType=VARCHAR} TRS.TAX_RULE_SETTING_ID = TRSO.TAX_SETTING_ID
AND trs.period = #{period,jdbcType=INTEGER} WHERE
(
TRS.IS_DEFAULT = 1
OR TRSO.ORGANIZATION_ID = #{organizationId,jdbcType=VARCHAR}
)
AND TRS.NAME = #{taxName,jdbcType=VARCHAR}
AND TRS.PERIOD = #{period,jdbcType=INTEGER}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
package com.neo.mybatter;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public class Format {
/** Format for just a space without newlines or blanks */
public static final Format SPACE = new Format(0, 0, 1);
/** Format for neither space nor newlines nor blanks */
public static final Format CLOSE_BY = new Format(0, 0, 0);
/** Number of line breaks to be written when writing this format */
@Getter
private final int newlineCount;
/** Number of indentions to add (+) or subtract (-) when writing this format */
@Getter
private final int indentionDelta;
/** Number of blanks to add (+) or substract (-) when writing this format */
@Getter
private final int blankCount;
/** Push indention after increasing or pop before decreasing it */
@Getter
private final boolean stackIndention;
public Format(int newlineCount, int indentionDelta, int blankCount) {
this(newlineCount, indentionDelta, blankCount, false);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package com.neo.mybatter;
enum TokenizerAction {
RETURN_PREVIOUS_TOKEN, CONSUME, CONSUME_AND_RECURSE_AND_RETURN_TOKEN, CONSUME_AND_RETURN_TOKEN
}
This diff is collapsed.
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