|
@@ -1,9 +1,93 @@
|
|
|
<?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.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper">
|
|
|
- <update id="updateChildBusType">
|
|
|
- update cw_reimbursement_type_info set business_type = #{businessType} where parent_id = #{id}
|
|
|
- </update>
|
|
|
+ <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
|
|
|
+ <id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
|
|
|
+
|
|
|
+ <result property="level" column="level" jdbcType="VARCHAR"/>
|
|
|
+ <result property="name" column="name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="sort" column="sort" jdbcType="VARCHAR"/>
|
|
|
+ <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
|
|
|
+ <collection property="officeDTOList" ofType="com.jeeplus.sys.service.dto.OfficeDTO" column="id" select="getOfficeClient"></collection>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ a.id,
|
|
|
+ a.create_by,
|
|
|
+ a.create_date,
|
|
|
+ a.update_by,
|
|
|
+ a.update_date,
|
|
|
+ a.del_flag,
|
|
|
+ a.level,
|
|
|
+ a.name,
|
|
|
+ a.sort,
|
|
|
+ a.parent_id,
|
|
|
+ a.parent_ids
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="officeColumns">
|
|
|
+ so.id as "id",
|
|
|
+ so.parent_id as "parent.id",
|
|
|
+ so.parent_ids as "parentIds",
|
|
|
+ so.name as "name",
|
|
|
+ so.sort as "sort",
|
|
|
+ so.area_id as "areaId",
|
|
|
+ so.code as "code",
|
|
|
+ so.type as "type",
|
|
|
+ so.grade as "grade",
|
|
|
+ so.address as "address",
|
|
|
+ so.zip_code as "zipCode",
|
|
|
+ so.master as "master",
|
|
|
+ so.phone as "phone",
|
|
|
+ so.fax as "fax",
|
|
|
+ so.email as "email",
|
|
|
+ so.useable as "useable",
|
|
|
+ so.primary_person as "primaryPerson",
|
|
|
+ so.deputy_person as "deputyPerson",
|
|
|
+ so.create_by as "createBy.id",
|
|
|
+ so.create_date as "createDate",
|
|
|
+ so.update_by as "updateBy.id",
|
|
|
+ so.update_date as "updateDate",
|
|
|
+ so.remarks as "remarks",
|
|
|
+ so.del_flag as "delFlag",
|
|
|
+ so.is_public as "isPublic",
|
|
|
+ so.administrator as "administrator"
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getOfficeClient" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
|
|
|
+ select
|
|
|
+ <include refid="officeColumns"></include>
|
|
|
+ from sys_office so
|
|
|
+ left join cw_reimbursement_type_office_info rtoi on rtoi.office_id = so.id and so.del_flag = '0'
|
|
|
+ where rtoi.reimbursement_type_id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findList" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"></include>
|
|
|
+ from cw_reimbursement_type_info a
|
|
|
+ ${ew.customSqlSegment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getById" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"></include>
|
|
|
+ from cw_reimbursement_type_info a
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0 and a.id = #{id}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="checkNameIsExist" resultType="java.lang.Integer">
|
|
|
SELECT
|
|
|
COUNT( 0 )
|
|
@@ -37,6 +121,16 @@
|
|
|
</select>
|
|
|
<select id="getAllList"
|
|
|
resultType="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
|
|
|
- select * from cw_reimbursement_type_info where business_type = #{type} and del_flag = '0' order by sort asc
|
|
|
+ select * from cw_reimbursement_type_info where del_flag = '0' order by sort asc
|
|
|
</select>
|
|
|
+
|
|
|
+ <delete id="deleteReimbursementTypeOfficeInfo">
|
|
|
+ delete from cw_reimbursement_type_office_info where reimbursement_type_id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <insert id="saveReimbursementTypeOfficeInfo">
|
|
|
+ <foreach collection="officeIdList" item="officeId" separator=";">
|
|
|
+ insert into cw_reimbursement_type_office_info(reimbursement_type_id,office_id) values(#{id},#{officeId})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
</mapper>
|