优化mybatis方法去掉冗余方法

This commit is contained in:
wh
2026-04-23 17:00:02 +08:00
parent 9483bea005
commit 2beebbe469
7 changed files with 23 additions and 73 deletions

View File

@@ -14,17 +14,6 @@
id, company_code, company_name, status, created_at, updated_at
</sql>
<insert id="insert" parameterType="com.labelsys.backend.entity.SysCompany">
insert into sys_company (id, company_code, company_name, status, created_at, updated_at)
values (#{id}, #{companyCode}, #{companyName}, #{status}, current_timestamp, current_timestamp)
</insert>
<select id="findById" resultMap="SysCompanyResultMap">
select <include refid="CompanyColumns"/>
from sys_company
where id = #{id}
</select>
<select id="findByCompanyCode" resultMap="SysCompanyResultMap">
select <include refid="CompanyColumns"/>
from sys_company
@@ -41,19 +30,13 @@
order by c.id
</select>
<select id="listAll" resultMap="SysCompanyResultMap">
select <include refid="CompanyColumns"/>
from sys_company
order by id
</select>
<update id="updateStatus">
update sys_company
set status = #{status}, updated_at = current_timestamp
where id = #{id}
</update>
<delete id="deleteAll">
delete from sys_company
</delete>
</mapper>
</mapper>