ganzi-api/inventory-dao/src/main/resources/mapper/SparePartMapper.xml

36 lines
1.5 KiB
XML
Raw Normal View History

<?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.rzyc.mapper.SparePartMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rzyc.model.SparePart">
<id column="spare_part_id" property="sparePartId" />
<result column="used_id" property="usedId" />
<result column="name" property="name" />
<result column="specification_model" property="specificationModel" />
<result column="spare_part_number" property="sparePartNumber" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
<result column="modify_by" property="modifyBy" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
spare_part_id, used_id, name, specification_model, spare_part_number, create_time, create_by, modify_by, modify_time
</sql>
<select id="sparePartList" resultMap="BaseResultMap">
select * from spare_part
<if test="null != name and '' != name ">
where `name` = #{name}
</if>
</select>
<update id="updateSparePart">
update spare_part set used_id = #{usedId} ,specification_model = #{specificationModel},spare_part_number = #{sparePartNumber} where spare_part_id = #{sparePartId}
</update>
</mapper>