JNBusinessTest/ruoyi-system/target/classes/mapper/authorize/AuthorizeMapper.xml

276 lines
20 KiB
XML
Raw Normal View History

2024-08-01 17:23:46 +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.ruoyi.authorize.mapper.AuthorizeMapper">
<resultMap type="Authorize" id="AuthorizeResult">
<result property="doaId" column="doa_id" />
<result property="doaCode" column="doa_code" />
<result property="doaNumber" column="doa_number" />
<result property="doaSalesmanCode" column="doa_salesman_code" />
<result property="doaSalesmanBm" column="doa_salesman_bm" />
<result property="doaSalesmanName" column="doa_salesman_name" />
<result property="doaSalesmanDeptId" column="doa_salesman_dept_id" />
<result property="doaSalesmanDeptName" column="doa_salesman_dept_name" />
<result property="doaSalesmanPhone" column="doa_salesman_phone" />
<result property="doaProject" column="doa_project" />
<result property="doaCustomerBm" column="doa_customer_bm" />
<result property="doaCustomerName" column="doa_customer_name" />
<result property="doaOwnerUnit" column="doa_owner_unit" />
<result property="doaGeneralcontractUnit" column="doa_generalcontract_unit" />
<result property="doaSubcontractUnit" column="doa_subcontract_unit" />
<result property="doaAuthorizer" column="doa_authorizer" />
<result property="doaAuthorizerPhone" column="doa_authorizer_phone" />
<result property="doaAuthorizerIdentificationNumber" column="doa_authorizer_identification_number" />
<result property="doaAuthorizationDuration" column="doa_authorization_duration" />
<result property="doaPowerAttorneyPurpose" column="doa_power_attorney_purpose" />
<result property="doaFormat" column="doa_format" />
<result property="doaRemark" column="doa_remark" />
<result property="doaRejectionReasons" column="doa_rejection_reasons" />
<result property="doaStandardizer" column="doa_standardizer" />
<result property="doaArchiving" column="doa_archiving" />
<result property="doaVicePresidentApproved" column="doa_vice_president_approved" />
<result property="doaApprovalStatus" column="doa_approval_status" />
<result property="doaOaApprovalStatus" column="doa_oa_approval_status" />
<result property="doaJlApprovalStatus" column="doa_jl_approval_status" />
<result property="createBy" column="create_by" />
<result property="createName" column="create_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="authorizeJoins">
left join sys_user u on u.user_name=a.create_by
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<sql id="selectAuthorizeVo">
select a.doa_id, a.doa_code, a.doa_number, a.doa_salesman_code, a.doa_salesman_bm, a.doa_salesman_name, a.doa_salesman_dept_id,
a.doa_salesman_dept_name, a.doa_salesman_phone, a.doa_project, a.doa_customer_bm, a.doa_customer_name,
a.doa_owner_unit, a.doa_generalcontract_unit, a.doa_subcontract_unit, a.doa_authorizer, a.doa_authorizer_phone,
a.doa_authorizer_identification_number, a.doa_authorization_duration, a.doa_power_attorney_purpose,
a.doa_format, a.doa_remark, a.doa_rejection_reasons, a.doa_standardizer, a.doa_archiving, a.doa_vice_president_approved,
a.doa_approval_status, a.doa_oa_approval_status, a.doa_jl_approval_status,
a.create_by, u.nick_name create_name, a.create_time, a.update_by, a.update_time
from authorize a
<include refid="authorizeJoins"/>
</sql>
<select id="selectAuthorizeList" parameterType="Authorize" resultMap="AuthorizeResult">
<include refid="selectAuthorizeVo"/>
<where>
<if test="doaCode != null and doaCode != ''"> and doa_code like concat('%', #{doaCode}, '%')</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''"> and doa_salesman_name like concat('%', #{doaSalesmanName}, '%')</if>
<if test="doaProject != null and doaProject != ''"> and doa_project like concat('%', #{doaProject}, '%')</if>
<if test="doaCustomerName != null and doaCustomerName != ''"> and doa_customer_name like concat('%', #{doaCustomerName}, '%')</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''"> and doa_authorizer like concat('%', #{doaAuthorizer}, '%')</if>
<if test="params.beginDoaAuthorizationDuration != null and params.beginDoaAuthorizationDuration != '' and params.endDoaAuthorizationDuration != null and params.endDoaAuthorizationDuration != ''"> and doa_authorization_duration between #{params.beginDoaAuthorizationDuration} and #{params.endDoaAuthorizationDuration}</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''"> and doa_power_attorney_purpose = #{doaPowerAttorneyPurpose}</if>
<if test="doaApprovalStatus != null and doaApprovalStatus != ''"> and doa_approval_status = #{doaApprovalStatus}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectAuthorizeByDoaId" parameterType="String" resultMap="AuthorizeResult">
<include refid="selectAuthorizeVo"/>
where doa_id = #{doaId}
</select>
<insert id="insertAuthorize" parameterType="Authorize">
insert into authorize
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="doaId != null">doa_id,</if>
<if test="doaCode != null">doa_code,</if>
<if test="doaNumber != null">doa_number,</if>
<if test="doaSalesmanCode != null">doa_salesman_code,</if>
<if test="doaSalesmanBm != null">doa_salesman_bm,</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''">doa_salesman_name,</if>
<if test="doaSalesmanDeptId != null">doa_salesman_dept_id,</if>
<if test="doaSalesmanDeptName != null">doa_salesman_dept_name,</if>
<if test="doaSalesmanPhone != null and doaSalesmanPhone != ''">doa_salesman_phone,</if>
<if test="doaProject != null and doaProject != ''">doa_project,</if>
<if test="doaCustomerBm != null">doa_customer_bm,</if>
<if test="doaCustomerName != null and doaCustomerName != ''">doa_customer_name,</if>
<if test="doaOwnerUnit != null">doa_owner_unit,</if>
<if test="doaGeneralcontractUnit != null">doa_generalcontract_unit,</if>
<if test="doaSubcontractUnit != null">doa_subcontract_unit,</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''">doa_authorizer,</if>
<if test="doaAuthorizerPhone != null and doaAuthorizerPhone != ''">doa_authorizer_phone,</if>
<if test="doaAuthorizerIdentificationNumber != null and doaAuthorizerIdentificationNumber != ''">doa_authorizer_identification_number,</if>
<if test="doaAuthorizationDuration != null">doa_authorization_duration,</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''">doa_power_attorney_purpose,</if>
<if test="doaFormat != null and doaFormat != ''">doa_format,</if>
<if test="doaRemark != null">doa_remark,</if>
<if test="doaRejectionReasons != null">doa_rejection_reasons,</if>
<if test="doaStandardizer != null">doa_standardizer,</if>
<if test="doaArchiving != null">doa_archiving,</if>
<if test="doaVicePresidentApproved != null">doa_vice_president_approved,</if>
<if test="doaApprovalStatus != null">doa_approval_status,</if>
<if test="doaOaApprovalStatus != null">doa_oa_approval_status,</if>
<if test="doaJlApprovalStatus != null">doa_jl_approval_status,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="doaId != null">#{doaId},</if>
<if test="doaCode != null">#{doaCode},</if>
<if test="doaNumber != null">#{doaNumber},</if>
<if test="doaSalesmanCode != null">#{doaSalesmanCode},</if>
<if test="doaSalesmanBm != null">#{doaSalesmanBm},</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''">#{doaSalesmanName},</if>
<if test="doaSalesmanDeptId != null">#{doaSalesmanDeptId},</if>
<if test="doaSalesmanDeptName != null">#{doaSalesmanDeptName},</if>
<if test="doaSalesmanPhone != null and doaSalesmanPhone != ''">#{doaSalesmanPhone},</if>
<if test="doaProject != null and doaProject != ''">#{doaProject},</if>
<if test="doaCustomerBm != null">#{doaCustomerBm},</if>
<if test="doaCustomerName != null and doaCustomerName != ''">#{doaCustomerName},</if>
<if test="doaOwnerUnit != null">#{doaOwnerUnit},</if>
<if test="doaGeneralcontractUnit != null">#{doaGeneralcontractUnit},</if>
<if test="doaSubcontractUnit != null">#{doaSubcontractUnit},</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''">#{doaAuthorizer},</if>
<if test="doaAuthorizerPhone != null and doaAuthorizerPhone != ''">#{doaAuthorizerPhone},</if>
<if test="doaAuthorizerIdentificationNumber != null and doaAuthorizerIdentificationNumber != ''">#{doaAuthorizerIdentificationNumber},</if>
<if test="doaAuthorizationDuration != null">#{doaAuthorizationDuration},</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''">#{doaPowerAttorneyPurpose},</if>
<if test="doaFormat != null and doaFormat != ''">#{doaFormat},</if>
<if test="doaRemark != null">#{doaRemark},</if>
<if test="doaRejectionReasons != null">#{doaRejectionReasons},</if>
<if test="doaStandardizer != null">#{doaStandardizer},</if>
<if test="doaArchiving != null">#{doaArchiving},</if>
<if test="doaVicePresidentApproved != null">#{doaVicePresidentApproved},</if>
<if test="doaApprovalStatus != null">#{doaApprovalStatus},</if>
<if test="doaOaApprovalStatus != null">#{doaOaApprovalStatus},</if>
<if test="doaJlApprovalStatus != null">#{doaJlApprovalStatus},</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>
</trim>
</insert>
<insert id="insertSysOAAuthorize" parameterType="SysOaAuthorize">
insert into sys_oa_authorize
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">user_id,</if>
<if test="departmentId != null and departmentId != ''">department_id,</if>
<if test="submissionTime != null and submissionTime != ''">submission_time,</if>
<if test="doaId != null">doa_id,</if>
<if test="doaCode != null">doa_code,</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''">doa_salesman_name,</if>
<if test="doaSalesmanPhone != null and doaSalesmanPhone != ''">doa_salesman_phone,</if>
<if test="doaProject != null and doaProject != ''">doa_project,</if>
<if test="doaCustomerName != null and doaCustomerName != ''">doa_customer_name,</if>
<if test="doaOwnerUnit != null">doa_owner_unit,</if>
<if test="doaGeneralcontractUnit != null">doa_generalcontract_unit,</if>
<if test="doaSubcontractUnit != null">doa_subcontract_unit,</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''">doa_authorizer,</if>
<if test="doaAuthorizerPhone != null and doaAuthorizerPhone != ''">doa_authorizer_phone,</if>
<if test="doaAuthorizerIdentificationNumber != null and doaAuthorizerIdentificationNumber != ''">doa_authorizer_identification_number,</if>
<if test="doaAuthorizationDuration != null">doa_authorization_duration,</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''">doa_power_attorney_purpose,</if>
<if test="doaFormat != null and doaFormat != ''">doa_format,</if>
<if test="doaRemark != null">doa_remark,</if>
<if test="doaStandardizer != null">doa_standardizer,</if>
<if test="doaArchiving != null">doa_archiving,</if>
<if test="doaVicePresidentApproved != null">doa_vice_president_approved,</if>
<if test="createTime != null">create_time,</if>
<if test="fileAddress != null and fileAddress != ''">file_address,</if>
<if test="isFinish != null and isFinish != ''">isFinish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null and userId != ''">#{userId},</if>
<if test="departmentId != null and departmentId != ''">#{departmentId},</if>
<if test="submissionTime != null and submissionTime != ''">#{submissionTime},</if>
<if test="doaId != null">#{doaId},</if>
<if test="doaCode != null">#{doaCode},</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''">#{doaSalesmanName},</if>
<if test="doaSalesmanPhone != null and doaSalesmanPhone != ''">#{doaSalesmanPhone},</if>
<if test="doaProject != null and doaProject != ''">#{doaProject},</if>
<if test="doaCustomerName != null and doaCustomerName != ''">#{doaCustomerName},</if>
<if test="doaOwnerUnit != null">#{doaOwnerUnit},</if>
<if test="doaGeneralcontractUnit != null">#{doaGeneralcontractUnit},</if>
<if test="doaSubcontractUnit != null">#{doaSubcontractUnit},</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''">#{doaAuthorizer},</if>
<if test="doaAuthorizerPhone != null and doaAuthorizerPhone != ''">#{doaAuthorizerPhone},</if>
<if test="doaAuthorizerIdentificationNumber != null and doaAuthorizerIdentificationNumber != ''">#{doaAuthorizerIdentificationNumber},</if>
<if test="doaAuthorizationDuration != null">#{doaAuthorizationDuration},</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''">#{doaPowerAttorneyPurpose},</if>
<if test="doaFormat != null and doaFormat != ''">#{doaFormat},</if>
<if test="doaRemark != null">#{doaRemark},</if>
<if test="doaStandardizer != null">#{doaStandardizer},</if>
<if test="doaArchiving != null">#{doaArchiving},</if>
<if test="doaVicePresidentApproved != null">#{doaVicePresidentApproved},</if>
<if test="createTime != null">#{createTime},</if>
<if test="fileAddress != null and fileAddress != ''">#{fileAddress},</if>
<if test="isFinish != null and isFinish != ''">#{isFinish},</if>
</trim>
</insert>
<update id="updateAuthorize" parameterType="Authorize">
update authorize
<trim prefix="SET" suffixOverrides=",">
<if test="doaCode != null">doa_code = #{doaCode},</if>
<if test="doaNumber != null">doa_number = #{doaNumber},</if>
<if test="doaSalesmanCode != null">doa_salesman_code = #{doaSalesmanCode},</if>
<if test="doaSalesmanBm != null">doa_salesman_bm = #{doaSalesmanBm},</if>
<if test="doaSalesmanName != null and doaSalesmanName != ''">doa_salesman_name = #{doaSalesmanName},</if>
<if test="doaSalesmanDeptId != null">doa_salesman_dept_id = #{doaSalesmanDeptId},</if>
<if test="doaSalesmanDeptName != null">doa_salesman_dept_name = #{doaSalesmanDeptName},</if>
<if test="doaSalesmanPhone != null and doaSalesmanPhone != ''">doa_salesman_phone = #{doaSalesmanPhone},</if>
<if test="doaProject != null and doaProject != ''">doa_project = #{doaProject},</if>
<if test="doaCustomerBm != null">doa_customer_bm = #{doaCustomerBm},</if>
<if test="doaCustomerName != null and doaCustomerName != ''">doa_customer_name = #{doaCustomerName},</if>
<if test="doaOwnerUnit != null">doa_owner_unit = #{doaOwnerUnit},</if>
<if test="doaGeneralcontractUnit != null">doa_generalcontract_unit = #{doaGeneralcontractUnit},</if>
<if test="doaSubcontractUnit != null">doa_subcontract_unit = #{doaSubcontractUnit},</if>
<if test="doaAuthorizer != null and doaAuthorizer != ''">doa_authorizer = #{doaAuthorizer},</if>
<if test="doaAuthorizerPhone != null and doaAuthorizerPhone != ''">doa_authorizer_phone = #{doaAuthorizerPhone},</if>
<if test="doaAuthorizerIdentificationNumber != null and doaAuthorizerIdentificationNumber != ''">doa_authorizer_identification_number = #{doaAuthorizerIdentificationNumber},</if>
<if test="doaAuthorizationDuration != null">doa_authorization_duration = #{doaAuthorizationDuration},</if>
<if test="doaPowerAttorneyPurpose != null and doaPowerAttorneyPurpose != ''">doa_power_attorney_purpose = #{doaPowerAttorneyPurpose},</if>
<if test="doaFormat != null and doaFormat != ''">doa_format = #{doaFormat},</if>
<if test="doaRemark != null">doa_remark = #{doaRemark},</if>
<if test="doaRejectionReasons != null">doa_rejection_reasons = #{doaRejectionReasons},</if>
<if test="doaStandardizer != null">doa_standardizer = #{doaStandardizer},</if>
<if test="doaArchiving != null">doa_archiving = #{doaArchiving},</if>
<if test="doaVicePresidentApproved != null">doa_vice_president_approved = #{doaVicePresidentApproved},</if>
<if test="doaApprovalStatus != null">doa_approval_status = #{doaApprovalStatus},</if>
<if test="doaOaApprovalStatus != null">doa_oa_approval_status = #{doaOaApprovalStatus},</if>
<if test="doaJlApprovalStatus != null">doa_jl_approval_status = #{doaJlApprovalStatus},</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>
</trim>
where doa_id = #{doaId}
</update>
<delete id="deleteAuthorizeByDoaId" parameterType="String">
delete from authorize where doa_id = #{doaId}
</delete>
<delete id="deleteAuthorizeByDoaIds" parameterType="String">
delete from authorize where doa_id in
<foreach item="doaId" collection="array" open="(" separator="," close=")">
#{doaId}
</foreach>
</delete>
<select id="getCode" resultType="String" statementType="CALLABLE">
{call GetSerialNo(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id="getCodeAT" resultType="String" statementType="CALLABLE">
{call GetSerialNo_Business(#{type,mode=IN,jdbcType=VARCHAR})}
</select>
<select id="selectOAUserByUserName" resultType="SysOaAuthorize">
select top 1 id as userId,departmentid as departmentId from HrmResource where loginid = #{loginid}
</select>
</mapper>