Skip to content

Commit 856c07f

Browse files
committed
fix deleteById & getById for Java-Mybatis
1 parent 44711d0 commit 856c07f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

build/version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<VersionMajor>2</VersionMajor>
44
<VersionMinor>3</VersionMinor>
5-
<VersionPatch>4</VersionPatch>
5+
<VersionPatch>5</VersionPatch>
66
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
77
</PropertyGroup>
88
</Project>

src/SmartCode.Generator/RazorTemplates/Java/SqlMap-Partials/CURD/SqlMap-Delete.cshtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
@if (logicalDeleteKey != null)
1414
{
1515
<update id="deleteById">
16+
<bind name="id" value="_parameter"/>
1617
update @table.Name
1718
set @logicalDeleteKey =1
18-
where @pkCol.Name=#{@pkCol.ConvertedName}
19+
where @pkCol.Name=#{id}
1920
</update>
2021
}
2122
else
2223
{
2324
<delete id="deleteById">
25+
<bind name="id" value="_parameter"/>
2426
delete from @table.Name
25-
where @pkCol.Name=#{@pkCol.ConvertedName}
27+
where @pkCol.Name=#{id}
2628
</delete>
2729
}

src/SmartCode.Generator/RazorTemplates/Java/SqlMap-Partials/CURD/SqlMap-GetById.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
}
1111

1212
<select id="getById" resultMap="@resultMapName">
13+
<bind name="id" value="_parameter"/>
1314
select * from @table.Name
14-
where @pkCol.Name=#{@pkCol.ConvertedName}
15+
where @pkCol.Name=#{id}
1516
limit 1
1617
</select>

0 commit comments

Comments
 (0)