PtlAgreementAttributionMapper.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. paa.create_time,
  23. paa.update_time,
  24. eic.name_simple as insCompanyName,
  25. pau.url as url,
  26. sd.name as deptName
  27. from
  28. ptl_agreement_attribution paa
  29. left join ptl_agreement_url pau on paa.login_url = pau.id
  30. left join sys_dept sd on paa.user_dept = sd.id
  31. left join esm_ins_company eic on paa.ins_company_id = eic.id
  32. where
  33. 1=1
  34. and paa.is_delete = '0'
  35. <if test="ptlAgreementAttributionQueryVo.username != null and ptlAgreementAttributionQueryVo.username != ''">
  36. and paa.username like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  37. or paa.user_abbr like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  38. or eic.name_simple like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  39. </if>
  40. <if test="ptlAgreementAttributionQueryVo.quoteStatus != null and ptlAgreementAttributionQueryVo.quoteStatus != ''">
  41. and paa.quote_status = #{ptlAgreementAttributionQueryVo.quoteStatus}
  42. </if>
  43. <if test="ptlAgreementAttributionQueryVo.insCompanyId != null and ptlAgreementAttributionQueryVo.insCompanyId != ''">
  44. and paa.ins_company_id = #{ptlAgreementAttributionQueryVo.insCompanyId}
  45. </if>
  46. <if test="ptlAgreementAttributionQueryVo.useStatus != null and ptlAgreementAttributionQueryVo.useStatus != ''">
  47. and paa.use_status = #{ptlAgreementAttributionQueryVo.useStatus}
  48. </if>
  49. <if test="ptlAgreementAttributionQueryVo.userDept != null and ptlAgreementAttributionQueryVo.userDept != ''">
  50. and paa.user_dept = #{ptlAgreementAttributionQueryVo.userDept}
  51. </if>
  52. order by paa.create_time desc
  53. </select>
  54. <select id="getAgreementAttribution" resultMap="BaseResultMap">
  55. select
  56. *,
  57. pau.url as url,
  58. sd.name as deptName
  59. from
  60. ptl_agreement_attribution paa
  61. left join ptl_agreement_url pau on paa.login_url = pau.id
  62. left join sys_dept sd on paa.user_dept = sd.id
  63. where
  64. 1=1
  65. and paa.is_delete = '0'
  66. <if test="id != null and id != ''">
  67. and paa.id = #{id}
  68. </if>
  69. </select>
  70. </mapper>