Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 1.55 KB

File metadata and controls

54 lines (44 loc) · 1.55 KB

✅ 고객기업관리 CRUD

  • 요구사항

    • 임원진 및 영업팀 소속 구성원만 고객기업 정보 CRUD 가능
  • SQL (MySQL 기준)

    • 전체 데이터 목록조회

      <select id="clntlist" resultType="kr.happyjob.study.busClm.model.ClntModel">
      	SELECT 
      		        cl.clnt_no
      		      , cl.clnt_name
      		      , cl.clnt_tel
      		      , cl.clnt_mng
      		      , cl.clnt_hp
      		      , cl.clnt_zip
      		      , cl.bk_cd
      		      , dc.detail_name AS bk_name
      		      , cl.clnt_acc
      		      , cl.clnt_add
      		      , cl.clnt_add_dt
      		      , cl.clnt_indst
      		      , cl.clnt_indst_no
      		      , cl.clnt_memo
      		      , cl.clnt_email
      	FROM tb_clnt cl
      	INNER JOIN tb_detail_code dc ON dc.group_code = 'bk_cd' AND dc.detail_code = cl.bk_cd
      	<where>
      		<if test="(sname != null) and (!sname.equals(''))">
      		    <choose>
      			    <when test="searchKey eq 'cl_name'.toString()">
      			        and cl.clnt_name Like CONCAT('%', #{sname}, '%')
                      </when>
                      <when test="searchKey eq 'cl_indst_no'.toString()">
                          and cl.clnt_indst_no LIKE CONCAT('%', #{sname}, '%')
                      </when>
                      <otherwise>
                          and ( cl.clnt_name Like CONCAT('%', #{sname}, '%') or cl.clnt_indst_no LIKE CONCAT('%', #{sname}, '%') )
                      </otherwise>
                  </choose>
              </if>
          </where>
          ORDER BY cl.clnt_no
          LIMIT #{pageindex}, #{pageSize}
      </select>