You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
4.2 KiB
XML
102 lines
4.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.shxy.xymanager_dao.dao.LinesDao">
|
|
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Lines">
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
|
|
<result column="dy_level_id" jdbcType="INTEGER" property="dyLevelId"/>
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="LineAndDyNameMap" type="com.shxy.xymanager_common.dto.LineAndDyNameDto">
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
|
|
<result column="dy_level_id" jdbcType="INTEGER" property="dyLevelId"/>
|
|
<result column="dy_level_name" jdbcType="INTEGER" property="dyLevelName"/>
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
<result column="dy_id" jdbcType="INTEGER" property="dyId"/>
|
|
<result column="dy_value" jdbcType="INTEGER" property="dyValue"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id, name, bs_manufacturer, dy_level_id
|
|
</sql>
|
|
<select id="selectAll" resultMap="LineAndDyNameMap">
|
|
select
|
|
x.id as id,
|
|
x.name as name,
|
|
x.bs_manufacturer as bs_manufacturer,
|
|
x.dy_level_id as dy_level_id,
|
|
x.status as status,
|
|
y.name as dy_level_name,
|
|
y.dy_value as dy_value,
|
|
y.id as dy_id
|
|
from `lines` x,
|
|
dy_level y
|
|
where x.dy_level_id = y.id and x.status = #{status} order by x.create_time desc
|
|
</select>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from `lines`
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
|
|
<select id="selectLineByDyId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from `lines`
|
|
where status = #{status}
|
|
<if test="dyid != null">
|
|
and dy_level_id = #{dyid}
|
|
</if>
|
|
</select>
|
|
|
|
<insert id="insertList" parameterType="java.util.List">
|
|
insert into `lines`
|
|
(name,bs_manufacturer,dy_level_id,status,create_time,update_time)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.name},#{item.bsManufacturer},#{item.dyLevelId},#{status},#{createat},#{updateat})
|
|
</foreach>
|
|
</insert>
|
|
<update id="deleteById">
|
|
update `lines`
|
|
set status = #{status},
|
|
update_time = #{updateat}
|
|
where id in
|
|
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
|
#{item.id}
|
|
</foreach>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.Lines">
|
|
update `lines`
|
|
<set>
|
|
<if test="data.name != null">
|
|
name = #{data.name,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="data.bsManufacturer != null">
|
|
bs_manufacturer = #{data.bsManufacturer,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="data.dyLevelId != null">
|
|
dy_level_id = #{data.dyLevelId,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="updateat != null">
|
|
update_time = #{updateat,jdbcType=TIMESTAMP},
|
|
</if>
|
|
</set>
|
|
where id = #{data.id}
|
|
</update>
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.Lines">
|
|
update `lines`
|
|
set name = #{name,jdbcType=VARCHAR},
|
|
bs_manufacturer = #{bsManufacturer,jdbcType=VARCHAR},
|
|
dy_level_id = #{dyLevelId,jdbcType=TINYINT}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
</mapper> |