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.
149 lines
6.2 KiB
XML
149 lines
6.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.op.quality.mapper.QcMaterialGroupMapper">
|
|
|
|
<resultMap type="QcMaterialGroup" id="QcMaterialGroupResult">
|
|
<result property="id" column="id"/>
|
|
<result property="groupName" column="group_name"/>
|
|
<result property="attr1" column="attr1"/>
|
|
<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="factoryCode" column="factory_code"/>
|
|
<result property="delFlag" column="del_flag"/>
|
|
<result property="groupCode" column="group_code"/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectQcMaterialGroupVo">
|
|
select id, group_name, attr1, create_by, create_time,
|
|
update_by, update_time, factory_code, del_flag
|
|
from qc_material_group
|
|
</sql>
|
|
|
|
<select id="selectQcMaterialGroupList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
|
|
<include refid="selectQcMaterialGroupVo"/>
|
|
<where>
|
|
<if test="groupName != null and groupName != ''">and group_name like concat('%', #{groupName}, '%')</if>
|
|
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
|
|
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
/*select
|
|
mg.id,
|
|
mg.group_name,
|
|
mgd.group_id AS parentId,
|
|
mgd.member_name AS memberName
|
|
from qc_material_group AS mg
|
|
LEFT JOIN qc_material_group_detail AS mgd ON mg.id = mgd.group_id AND mgd.del_flag = '0'
|
|
WHERE mg.del_flag = '0'*/
|
|
</select>
|
|
|
|
<select id="getOriginalGroupList" parameterType="QcMaterialGroup" resultType="QcMaterialGroup">
|
|
SELECT DISTINCT
|
|
mvgr5 groupCode,
|
|
mvgr5 groupName
|
|
FROM base_product
|
|
WHERE del_flag = '0' AND mvgr5 IS NOT NULL
|
|
</select>
|
|
|
|
<select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
|
|
select
|
|
id,
|
|
group_id AS parentId,
|
|
material_name AS group_name
|
|
from qc_material_group_detail
|
|
where del_flag = '0'
|
|
<if test="id != null and id != ''">
|
|
AND group_id = #{id}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
<select id="selectQcMaterialGroupById" parameterType="String" resultMap="QcMaterialGroupResult">
|
|
select id, group_name, attr1, create_by, create_time,
|
|
update_by, update_time, factory_code, del_flag,
|
|
group_code
|
|
from qc_material_group
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertQcMaterialGroup" parameterType="QcMaterialGroup">
|
|
insert into qc_material_group
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="groupName != null">group_name,</if>
|
|
<if test="groupCode != null">group_code,</if>
|
|
<if test="attr1 != null">attr1,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="groupName != null">#{groupName},</if>
|
|
<if test="groupCode != null">#{groupCode},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateQcMaterialGroup" parameterType="QcMaterialGroup">
|
|
update qc_material_group
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="groupName != null">group_name = #{groupName},</if>
|
|
<if test="groupCode != null">group_code = #{groupCode},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteQcMaterialGroupById" parameterType="String">
|
|
update qc_material_group set del_flag = '1' where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteQcMaterialGroupByIds" parameterType="String">
|
|
update qc_material_group set del_flag = '1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="deleteGroupDetailById">
|
|
delete from qc_material_group_detail where group_id = #{id}
|
|
</delete>
|
|
<select id="validationData" parameterType="String" resultMap="QcMaterialGroupResult">
|
|
select
|
|
id,
|
|
create_by,
|
|
create_time
|
|
from qc_check_type_project
|
|
where group_id = #{id}
|
|
</select>
|
|
<select id="selectGroupIdByName" resultType="java.lang.String">
|
|
select id from qc_material_group where group_name = #{groupName} and del_flag = '0'
|
|
</select>
|
|
<select id="getAutoDataOption" resultType="com.op.system.api.domain.SysDictData">
|
|
select dict_value dictValue,dict_label dictLabel
|
|
from base_dict_data
|
|
where dict_type = #{dictType}
|
|
</select>
|
|
</mapper>
|