107 lines
5.2 KiB
XML
107 lines
5.2 KiB
XML
<?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.ruoyi.system.mapper.EtHardwareVersionMapper">
|
|
|
|
<resultMap type="EtHardwareVersion" id="EtHardwareVersionResult">
|
|
<result property="id" column="id" />
|
|
<result property="version" column="version" />
|
|
<result property="productionTime" column="production_time" />
|
|
<result property="quantity" column="quantity" />
|
|
<result property="notEnteredNum" column="not_entered_num" />
|
|
<result property="instructions" column="instructions" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="ancestors" column="ancestors" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEtHardwareVersionVo">
|
|
select id, version, production_time, quantity, not_entered_num, instructions, create_time, parent_id, ancestors, remark from et_hardware_version
|
|
</sql>
|
|
|
|
<select id="selectEtHardwareVersionList" parameterType="EtHardwareVersion" resultMap="EtHardwareVersionResult">
|
|
<include refid="selectEtHardwareVersionVo"/>
|
|
<where>
|
|
<if test="version != null and version != ''"> and version = #{version}</if>
|
|
<if test="productionTime != null "> and production_time = #{productionTime}</if>
|
|
<if test="instructions != null and instructions != ''"> and instructions = #{instructions}</if>
|
|
</where>
|
|
order by version
|
|
</select>
|
|
|
|
<select id="selectEtHardwareVersionListExclude" parameterType="EtHardwareVersion" resultMap="EtHardwareVersionResult">
|
|
<include refid="selectEtHardwareVersionVo"/>
|
|
where parent_id !=0
|
|
<if test="version != null and version != ''"> and version = #{version}</if>
|
|
<if test="productionTime != null "> and production_time = #{productionTime}</if>
|
|
<if test="instructions != null and instructions != ''"> and instructions = #{instructions}</if>
|
|
order by version
|
|
</select>
|
|
|
|
<select id="selectEtHardwareVersionById" parameterType="Long" resultMap="EtHardwareVersionResult">
|
|
<include refid="selectEtHardwareVersionVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<select id="countChildrenNum" resultType="java.lang.Integer">
|
|
select COALESCE(sum(quantity), 0) from et_hardware_version where parent_id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEtHardwareVersion" parameterType="EtHardwareVersion">
|
|
insert into et_hardware_version
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="version != null">version,</if>
|
|
<if test="productionTime != null">production_time,</if>
|
|
<if test="quantity != null">quantity,</if>
|
|
<if test="notEnteredNum != null">not_entered_num,</if>
|
|
<if test="instructions != null">instructions,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="parentId != null">parent_id,</if>
|
|
<if test="ancestors != null">ancestors,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="version != null">#{version},</if>
|
|
<if test="productionTime != null">#{productionTime},</if>
|
|
<if test="quantity != null">#{quantity},</if>
|
|
<if test="notEnteredNum != null">#{notEnteredNum},</if>
|
|
<if test="instructions != null">#{instructions},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="parentId != null">#{parentId},</if>
|
|
<if test="ancestors != null">#{ancestors},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEtHardwareVersion" parameterType="EtHardwareVersion">
|
|
update et_hardware_version
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="version != null">version = #{version},</if>
|
|
<if test="productionTime != null">production_time = #{productionTime},</if>
|
|
<if test="quantity != null">quantity = #{quantity},</if>
|
|
<if test="notEnteredNum != null">not_entered_num = #{notEnteredNum},</if>
|
|
<if test="instructions != null">instructions = #{instructions},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEtHardwareVersionById" parameterType="Long">
|
|
delete from et_hardware_version where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEtHardwareVersionByIds" parameterType="String">
|
|
delete from et_hardware_version where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|