Files
nanguangszwlback/mhd-modules/mhd-system/src/main/resources/mapper/basic/materialClassify/MaterialClassifyMapper.xml
T
2026-09-04 11:11:39 +08:00

108 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.mhd.basic.domain.materialClassify.repository.mapper.MaterialClassifyMapper">
<resultMap type="com.mhd.basic.domain.materialClassify.repository.po.MaterialClassifyPO" id="MaterialClassifyResult">
<result property="materialClassifyId" column="material_classify_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="level" column="level" />
<result property="parentCode" column="parent_code" />
<result property="parentName" column="parent_name" />
<result property="codePath" column="code_path" />
<result property="namePath" column="name_path" />
<result property="remark" column="remark" />
<result property="nullify" column="nullify" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="chargeStandard" column="charge_standard" />
<result property="unit" column="unit" />
<result property="monthlyWarehouseRent" column="monthly_warehouse_rent" />
<result property="halfMonthWarehouseRent" column="half_month_warehouse_rent" />
<result property="monthlyWarehouseRentUnit" column="monthly_warehouse_rent_unit" />
<result property="halfMonthWarehouseRentUnit" column="half_month_warehouse_rent_unit" />
</resultMap>
<sql id="selectMaterialClassifyPo">
select material_classify_id, organization_id, organization_name, top_organization_id, code, name, level, parent_code,
parent_name, code_path, name_path, remark, nullify, create_time, create_by, create_by_name, update_time, update_by,
update_by_name, del_flag,CHARGE_STANDARD,unit,
monthly_warehouse_rent, half_month_warehouse_rent, monthly_warehouse_rent_unit, half_month_warehouse_rent_unit
from material_classify
</sql>
<sql id="selectMaterialClassifyPo1">
<where>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="level != null ">
and level = #{level}
</if>
<if test="parentCode != null and parentCode != ''">
and parent_code = #{parentCode}
</if>
<if test="parentName != null and parentName != ''">
and parent_name like concat('%', #{parentName}, '%')
</if>
<if test="codePath != null and codePath != ''">
and code_path = #{codePath}
</if>
<if test="namePath != null and namePath != ''">
and name_path = #{namePath}
</if>
<if test="nullify != null ">
and nullify = #{nullify}
</if>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
<choose>
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
<otherwise> and del_flag = 1 </otherwise>
</choose>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.basic.domain.materialClassify.repository.todo.MaterialClassifyDO" resultMap="MaterialClassifyResult">
<include refid="selectMaterialClassifyPo"/>
<include refid="selectMaterialClassifyPo1"/>
ORDER BY create_time DESC
</select>
<select id="queryChildrenListByParentCode" parameterType="java.lang.String" resultMap="MaterialClassifyResult">
<include refid="selectMaterialClassifyPo"/>
WHERE
FIND_IN_SET(#{parentCode}, code_path) > 0
ORDER BY level ASC
</select>
</mapper>