|
|
|
@@ -14,12 +14,21 @@ |
|
|
|
<result property="state" column="state" jdbcType="INTEGER"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<!--查询单个--> |
|
|
|
<!-- 查询单个 --> |
|
|
|
<select id="queryById" resultMap="ImageMap"> |
|
|
|
select |
|
|
|
id,name,description,image_type,create_by,create_time,update_by,update_time,state |
|
|
|
from image |
|
|
|
where id = #{id} and state = 1 |
|
|
|
img.id, |
|
|
|
img.name, |
|
|
|
img.description, |
|
|
|
img.image_type, |
|
|
|
img.create_by, |
|
|
|
img.create_time, |
|
|
|
img.update_by, |
|
|
|
img.update_time, |
|
|
|
img.state, |
|
|
|
(SELECT COUNT(*) FROM image_version WHERE image_version.image_id = img.id AND image_version.state = 1) as versionCount |
|
|
|
from image img |
|
|
|
where img.id = #{id} and img.state = 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--查询指定行数据--> |
|
|
|
|