water-design-const-service/water-design-const/src/main/resources/mapper/ModelMapper.xml

42 lines
2.0 KiB
XML
Raw Normal View History

2025-07-11 13:29:48 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.waterdesign.mapper.ModelMapper">
<insert id="addModel" useGeneratedKeys="true" keyProperty="id">
insert into tb_model(
<if test="projectId != null and projectId != 0">project_id,</if>
<if test="modelName != null and modelName != ''">model_name,</if>
<if test="modelUrl != null and modelUrl != ''">model_url,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="version != null and version != ''">version,</if>
<if test="designer != null and designer != ''">designer,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="modelType != null and modelType != ''">model_type,</if>
<if test="modelIds != null and modelIds != ''">model_ids,</if>
<if test="createBy != null and createBy != ''">create_user,</if>
create_time
)values(
<if test="projectId != null and projectId != 0">#{projectId},</if>
<if test="modelName != null and modelName != ''">#{modelName},</if>
<if test="modelUrl != null and modelUrl != ''">#{modelUrl},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="version != null and version != ''">#{version},</if>
<if test="designer != null and designer != ''">#{designer},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="modelType != null and modelType != ''">#{modelType},</if>
<if test="modelIds != null and modelIds != ''">#{modelIds},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<select id="list" resultType="com.bonus.waterdesign.domain.Model">
select tm.id as id,tm.project_id as project_id,tm.model_name as modelName,tm.model_url as modelUrl,
tm.file_name as fileName,tm.version as version,su.user_name as designerName,tm.remark as remark
from tb_model tm
left join sys_user su on tm.designer = su.user_id
</select>
</mapper>