ganzi-api/inventory-dao/src/main/resources/mapper/ex/ExExamineItemMapper.xml

52 lines
2.1 KiB
XML
Raw Normal View History

2024-04-01 16:01:32 +08:00
<?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.rzyc.mapper.ex.ExExamineItemMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rzyc.model.ex.ExExamineItem">
<id column="item_id" property="itemId" />
<result column="examine_id" property="examineId" />
<result column="title" property="title" />
<result column="item_score" property="itemScore" />
<result column="parent_id" property="parentId" />
<result column="parent_path" property="parentPath" />
2024-04-01 17:30:43 +08:00
<result column="examine_state" property="examineState" />
2024-04-01 16:01:32 +08:00
<result column="item_type" property="itemType" />
<result column="sort_id" property="sortId" />
<result column="del_state" property="delState" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
<result column="modify_time" property="modifyTime" />
<result column="modify_by" property="modifyBy" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
2024-04-01 17:30:43 +08:00
item_id, examine_id,title, item_score, parent_id, parent_path,
examine_state,item_type, sort_id,
2024-04-01 16:01:32 +08:00
del_state, create_time, create_by, modify_time, modify_by
</sql>
2024-04-01 17:30:43 +08:00
<!--考核项列表-->
<select id="itemList" resultMap="BaseResultMap">
SELECT * FROM `ex_examine_item` ei
WHERE ei.`examine_id` = #{examineId}
AND ei.`examine_state` = #{examineState}
</select>
<!--顶级考核项列表-->
<select id="topItemList" resultMap="BaseResultMap">
SELECT * FROM `ex_examine_item` ei
WHERE ei.`examine_id` = #{examineId}
AND ei.`examine_state` = #{examineState}
AND (ei.`parent_id` IS NULL OR ei.`parent_id` = '')
</select>
<!--通过父级查询-->
<select id="findByParentId" resultMap="BaseResultMap">
SELECT ei.* FROM `ex_examine_item` ei
where ei.parent_id = #{parentId}
</select>
2024-04-01 16:01:32 +08:00
</mapper>