去除供应商类型多余代码
This commit is contained in:
@@ -1,130 +0,0 @@
|
||||
<?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.bms.system.mapper.BmsSupplierTypeMapper">
|
||||
|
||||
<resultMap type="BmsSupplierType" id="BmsSupplierTypeResult">
|
||||
<id property="typeId" column="type_id" />
|
||||
<result property="typeCode" column="type_code" />
|
||||
<result property="typeName" column="type_name" />
|
||||
<result property="typeSort" column="type_sort" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectVo">
|
||||
select type_id, type_code, type_name, type_sort, status, remark,
|
||||
create_by, create_time, update_by, update_time, del_flag
|
||||
from bms_supplier_type
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="BmsSupplierType" resultMap="BmsSupplierTypeResult">
|
||||
<include refid="selectVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="typeName != null and typeName != ''">
|
||||
and type_name like concat('%', #{typeName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by type_sort asc, type_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="Long" resultMap="BmsSupplierTypeResult">
|
||||
<include refid="selectVo"/>
|
||||
where type_id = #{typeId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="countByTypeCode" resultType="int">
|
||||
select count(1) from bms_supplier_type
|
||||
where del_flag = '0' and type_code = #{typeCode}
|
||||
<if test="excludeId != null">and type_id != #{excludeId}</if>
|
||||
</select>
|
||||
|
||||
<select id="countByTypeName" resultType="int">
|
||||
select count(1) from bms_supplier_type
|
||||
where del_flag = '0' and type_name = #{typeName}
|
||||
<if test="excludeId != null">and type_id != #{excludeId}</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="BmsSupplierType" useGeneratedKeys="true" keyProperty="typeId">
|
||||
insert into bms_supplier_type (
|
||||
type_code, type_name, type_sort, status, remark, create_by, create_time, del_flag
|
||||
) values (
|
||||
#{typeCode}, #{typeName}, #{typeSort}, #{status}, #{remark}, #{createBy}, sysdate(), '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="BmsSupplierType">
|
||||
update bms_supplier_type
|
||||
<set>
|
||||
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
||||
<if test="typeSort != null">type_sort = #{typeSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where type_id = #{typeId} and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updateStatus" parameterType="BmsSupplierType">
|
||||
update bms_supplier_type
|
||||
set status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where type_id = #{typeId} and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds" parameterType="Long">
|
||||
update bms_supplier_type
|
||||
set del_flag = '1',
|
||||
type_code = concat(type_code, '#', type_id),
|
||||
type_name = concat(type_name, '#', type_id),
|
||||
update_time = sysdate()
|
||||
where del_flag = '0' and type_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectDictCode" resultType="java.lang.Long">
|
||||
select dict_code from sys_dict_data
|
||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDict" parameterType="BmsSupplierType">
|
||||
insert into sys_dict_data (
|
||||
dict_sort, dict_label, dict_value, dict_type, css_class, list_class,
|
||||
is_default, status, create_by, create_time, remark
|
||||
) values (
|
||||
#{typeSort}, #{typeName}, #{typeCode}, 'bms_supplier_type', '', 'primary',
|
||||
'N', #{status}, #{createBy}, sysdate(), #{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDict" parameterType="BmsSupplierType">
|
||||
update sys_dict_data
|
||||
set dict_sort = #{typeSort},
|
||||
dict_label = #{typeName},
|
||||
status = #{status},
|
||||
remark = #{remark},
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where dict_type = 'bms_supplier_type' and dict_value = #{typeCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDictByCode">
|
||||
delete from sys_dict_data
|
||||
where dict_type = 'bms_supplier_type' and dict_value = #{typeCode}
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user