기본 콘텐츠로 건너뛰기

6월, 2014의 게시물 표시

css 셀렉터 (jquery)

css selector 기본 문법. # : id 기준 #para1 {.....} (none) : 모든 element p {.....} . : class 이름 .center {.....} 약간 응용해서  만약 <p> elements 들 중에 class name이 center인것만 취하고 싶을 경우 p.center {.....} <span> elements 중 부모가 <p> elements 인경우 p > span {.....} 대강 이정도만 알고 있어도 기본적으로 css와 jquery에서 select하는게 답답함은 줄어들것이다. jquery의 경우는 일반적으로 css와 동일하다.  $('#paran1') - id $('p') - elements $(.center) - class 예제 :  http://jsfiddle.net/VCAHh/2/

mybatis 기본문법

select 기본 <select id="selectPerson" parameterType="int" resultType="hashmap"> SELECT * FROM PERSON WHERE ID = #{id} </select> 변수 설정은 #{} and #{id} and id like '%'||#{id}||'%' -- concat if문  <if test=""> -  예제도 그렇지만 보통 null 체크할때 많이 쓴다. <select id="findActiveBlogWithTitleLike" resultType="Blog"> SELECT * FROM BLOG WHERE state = ‘ACTIVE’ <if test="title != null"> AND title like #{title} </if> </select> choose,when,otherwise   - 게시판에서 전체/제목/내용에 따라 검색방법을 달리할때 처럼     해당 변수가 조회타입 (?)의 성격을 가질때 사용하면 좋을듯. <select id="findActiveBlogLike" resultType="Blog"> SELECT * FROM BLOG WHERE state = ‘ACTIVE’ <choose> <when test="title != null"> AND title like #{title} </when> <when test="author != null and author.name != null"> AND author_name like