PtlAgreementAttributionMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.jzg.mapper.PtlAgreementAttributionMapper">
  4. <resultMap id="BaseResultMap" type="com.jzg.commons.entity.agreement.po.PtlAgreementAttribution">
  5. <result property="fields" column="fields" javaType="com.alibaba.fastjson.JSONArray"
  6. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  7. </resultMap>
  8. <select id="getAgreementAttributionList" resultType="com.jzg.commons.entity.agreement.po.PtlAgreementAttribution">
  9. select
  10. paa.id,
  11. paa.template_id,
  12. paa.api_type,
  13. paa.login_url,
  14. paa.api_type,
  15. paa.username,
  16. paa.password,
  17. paa.user_abbr,
  18. paa.user_dept,
  19. paa.user_desc,
  20. paa.use_status,
  21. paa.quote_status,
  22. eic.name_simple as insCompanyName,
  23. pau.url as url,
  24. sd.name as deptName
  25. from
  26. ptl_agreement_attribution paa
  27. left join ptl_agreement_url pau on paa.login_url = pau.id
  28. left join sys_dept sd on paa.user_dept = sd.id
  29. left join esm_ins_company eic on paa.ins_company_id = eic.id
  30. where
  31. 1=1
  32. and paa.is_delete = '0'
  33. <if test="ptlAgreementAttributionQueryVo.username != null and ptlAgreementAttributionQueryVo.username != ''">
  34. and paa.username like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  35. or paa.user_abbr like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  36. </if>
  37. <if test="ptlAgreementAttributionQueryVo.quoteStatus != null and ptlAgreementAttributionQueryVo.quoteStatus != ''">
  38. and paa.quote_status = #{ptlAgreementAttributionQueryVo.quoteStatus}
  39. </if>
  40. <if test="ptlAgreementAttributionQueryVo.insCompanyId != null and ptlAgreementAttributionQueryVo.insCompanyId != ''">
  41. and paa.ins_company_id = #{ptlAgreementAttributionQueryVo.insCompanyId}
  42. </if>
  43. <if test="ptlAgreementAttributionQueryVo.useStatus != null and ptlAgreementAttributionQueryVo.useStatus != ''">
  44. and paa.use_status = #{ptlAgreementAttributionQueryVo.useStatus}
  45. </if>
  46. <if test="ptlAgreementAttributionQueryVo.userDept != null and ptlAgreementAttributionQueryVo.userDept != ''">
  47. and paa.user_dept = #{ptlAgreementAttributionQueryVo.userDept}
  48. </if>
  49. order by paa.create_time desc
  50. </select>
  51. <select id="getAgreementAttribution" resultMap="BaseResultMap">
  52. select
  53. *,
  54. pau.url as url,
  55. sd.name as deptName
  56. from
  57. ptl_agreement_attribution paa
  58. left join ptl_agreement_url pau on paa.login_url = pau.id
  59. left join sys_dept sd on paa.user_dept = sd.id
  60. where
  61. 1=1
  62. and paa.is_delete = '0'
  63. <if test="id != null and id != ''">
  64. and paa.id = #{id}
  65. </if>
  66. </select>
  67. </mapper>